X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=blobdiff_plain;f=tg-update.sh;h=288ec14f849495734fec17b839abf678f366ad78;hp=94c8b5d16d5521bc0105140a836dc931e7d8a018;hb=1930aaddd2164df67e68f0b75f38e20db44d242d;hpb=dfe1670c129c1ec6f46ae7b5cc610201a59cfbfd diff --git a/tg-update.sh b/tg-update.sh index 94c8b5d..288ec14 100644 --- a/tg-update.sh +++ b/tg-update.sh @@ -9,7 +9,7 @@ name= ## Parse options if [ -n "$1" ]; then - echo "Usage: tg update" >&2 + echo "Usage: tg [...] update" >&2 exit 1 fi @@ -75,7 +75,7 @@ if [ -s "$depcheck" ]; then info "Updating base with $dep changes..." if ! git merge "$dep"; then if [ -z "$TG_RECURSIVE" ]; then - resume='`$tg update` again' + resume="\`git checkout $name && $tg update\` again" else # subshell resume='exit' fi @@ -87,14 +87,16 @@ if [ -s "$depcheck" ]; then exit 2 fi done - - # Home, sweet home... - git checkout -q "$name" else info "The base is up-to-date." fi rm "$depcheck" +# Home, sweet home... +# (We want to always switch back, in case we were on the base from failed +# previous merge.) +git checkout -q "$name" + merge_with="refs/top-bases/$name" @@ -140,3 +142,5 @@ if ! git merge "$merge_with"; then fi exit 3 fi + +# vim:noet