chiark / gitweb /
tg create: Set up refs/top-bases/ after conflict resolution
[topgit.git] / tg-update.sh
index 5bd9de55455a5b2b1397c35e9e9b9851ec544491..27a8e81086f7eb71ba4c4c4d0e19aeabd6842a09 100644 (file)
@@ -23,7 +23,7 @@ base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)"
 
 depcheck="$(mktemp)"
 missing_deps=
-needs_update "$name" >"$depcheck"
+needs_update "$name" >"$depcheck" || :
 [ -z "$missing_deps" ] || die "some dependencies are missing: $missing_deps"
 if [ -s "$depcheck" ]; then
        # We need to switch to the base branch
@@ -39,8 +39,8 @@ if [ -s "$depcheck" ]; then
                sed 's/^\([^+]\)/-\1/' | # now each line is +branch or -branch (+ == recurse)
                uniq -s 1 | # fold branch lines; + always comes before - and thus wins within uniq
                while read depline; do
-                       action="${depline:0:1}"
-                       dep="${depline:1}"
+                       action="$(echo "$depline" | cut -c 1)"
+                       dep="$(echo "$depline" | cut -c 2-)"
 
                        # We do not distinguish between dependencies out-of-date
                        # and base out-of-date cases for $dep here, but thanks