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
This commit is contained in:
Sean Dague 2013-09-23 14:17:06 -04:00
parent e802cc4514
commit 835db2fead

View File

@ -548,12 +548,18 @@ function is_arch {
# Uses global ``OFFLINE`` # Uses global ``OFFLINE``
# git_clone remote dest-dir branch # git_clone remote dest-dir branch
function git_clone { function git_clone {
[[ "$OFFLINE" = "True" ]] && return
GIT_REMOTE=$1 GIT_REMOTE=$1
GIT_DEST=$2 GIT_DEST=$2
GIT_REF=$3 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 echo $GIT_REF | egrep -q "^refs"; then
# If our branch name is a gerrit style refs/changes/... # If our branch name is a gerrit style refs/changes/...
if [[ ! -d $GIT_DEST ]]; then if [[ ! -d $GIT_DEST ]]; then
@ -595,6 +601,10 @@ function git_clone {
fi fi
fi fi
# print out the results so we know what change was used in the logs
cd $GIT_DEST
git show --oneline
} }