Fix updating a git working copy when the head is detached

This commit is contained in:
Pierre Labastie 2013-09-22 07:14:33 +00:00
parent b86876a6ef
commit 7ce6de2ee4

View file

@ -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