chiark / gitweb /
tg export: Really remove TopGit metadata files when exporting
[topgit.git] / tg.sh
diff --git a/tg.sh b/tg.sh
index 4fef7796c53e59bc5829ca3a727c65a58e4eb3ab..16940f8de6d2dde6fdbf3633cb2a436de50b3e20 100644 (file)
--- a/tg.sh
+++ b/tg.sh
@@ -47,8 +47,8 @@ setup_ours()
 {
        if [ ! -s "$git_dir/info/attributes" ] || ! grep -q topmsg "$git_dir/info/attributes"; then
                {
-                       echo -e ".topmsg\tmerge=ours"
-                       echo -e ".topdeps\tmerge=ours"
+                       echo ".topmsg   merge=ours"
+                       echo ".topdeps  merge=ours"
                } >>"$git_dir/info/attributes"
        fi
        if ! git config merge.ours.driver >/dev/null; then
@@ -139,7 +139,7 @@ branch_needs_update()
                # _dep needs to be synced with its base
                echo ": $_dep $_depchain"
                _ret=1
-       elif ! branch_contains "refs/top-bases/$_name" "$_dep"; then
+       elif [ -n "$_name" ] && ! branch_contains "refs/top-bases/$_name" "$_dep"; then
                # Some new commits in _dep
                echo "$_dep $_depchain"
                _ret=1