chiark / gitweb /
debian/changelog: document new upstream release
[topgit.git] / tg-update.sh
index f36624fe71b73263471e5df8fbb0014d47ca2ee0..73280c65af79af2da50204582c7029a00cfcef34 100644 (file)
@@ -59,7 +59,7 @@ if [ -s "$depcheck" ]; then
                                        info "You are in a subshell. If you abort the merge,"
                                        info "use \`exit 1\` to abort the recursive update altogether."
                                        if ! sh -i </dev/tty; then
-                                               info "Ok, you aborated the merge. Now, you just need to"
+                                               info "Ok, you aborted the merge. Now, you just need to"
                                                info "switch back to some sane branch using \`git checkout\`."
                                                exit 3
                                        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