print out git references for trees
in order to be sure we understand the environment that's running
in an upstream test, print out the git information for the tree.
This will hopefully address questions of "which commit of tempest"
is being used for particular tests.
Change-Id: Ief4e8a17fd75945f02982d2adf8625fe927d823d
diff --git a/functions b/functions
index e1a5f4b..209f13c 100644
--- a/functions
+++ b/functions
@@ -548,12 +548,18 @@
# Uses global ``OFFLINE``
# git_clone remote dest-dir branch
function git_clone {
- [[ "$OFFLINE" = "True" ]] && return
-
GIT_REMOTE=$1
GIT_DEST=$2
GIT_REF=$3
+ if [[ "$OFFLINE" = "True" ]]; then
+ echo "Running in offline mode, clones already exist"
+ # print out the results so we know what change was used in the logs
+ cd $GIT_DEST
+ git show --oneline
+ return
+ fi
+
if echo $GIT_REF | egrep -q "^refs"; then
# If our branch name is a gerrit style refs/changes/...
if [[ ! -d $GIT_DEST ]]; then
@@ -595,6 +601,10 @@
fi
fi
+
+ # print out the results so we know what change was used in the logs
+ cd $GIT_DEST
+ git show --oneline
}