chiark / gitweb /
tg-delete.sh: Factor out the emptiness test to tg.sh:branch_empty()
[topgit.git] / tg-delete.sh
index 287c4fa738366fac09d0ce126a8f5a55d28644dc..f0114cc6b78568025116823078fc144c2e9cb05b 100644 (file)
@@ -35,7 +35,7 @@ baserev="$(git rev-parse --verify "refs/top-bases/$name" 2>/dev/null)" ||
        die "cannot delete your current branch"
 
 nonempty=
-[ -z "$(git diff-tree "refs/top-bases/$name" "$name" | fgrep -v "      .top")" ] || nonempty=1
+branch_empty "$name" || nonempty=1
 
 [ -z "$nonempty" ] || [ -n "$force" ] || die "branch is non-empty: $name"