From 7ce6de2ee49922adb74e4f40ce8124af3cdd6bec Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Sun, 22 Sep 2013 07:14:33 +0000 Subject: [PATCH] Fix updating a git working copy when the head is detached --- common/libs/func_book_parser | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser index 0b61e37..401afbc 100644 --- a/common/libs/func_book_parser +++ b/common/libs/func_book_parser @@ -31,12 +31,17 @@ get_book() { # if [ ! $TREE == "development" ]; then cd ${PROGNAME}-$LFSVRS echo "Checking out $LFSVRS at $PWD in $TREE" - git checkout ${TREE} >>$LOGDIR/$LOG 2>&1 + git checkout -b ${TREE} ${TREE} >>$LOGDIR/$LOG 2>&1 fi else cd ${PROGNAME}-$LFSVRS case $PROGNAME in - clfs*) git pull >>$LOGDIR/$LOG 2>&1 ;; + clfs*) git checkout master >>$LOGDIR/$LOG 2>&1 + git pull >>$LOGDIR/$LOG 2>&1 + if [ ! $TREE == "development" ]; then + git checkout ${TREE} >>$LOGDIR/$LOG 2>&1 + fi + ;; lfs | hlfs) svn up >>$LOGDIR/$LOG 2>&1 ;; *) ;; esac