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"
} || : # $1 is not tracked by TopGit anymore
}
+# branch_empty NAME
+branch_empty()
+{
+ [ -z "$(git diff-tree "refs/top-bases/$1" "$1" | fgrep -v " .top")" ]
+}
+
# switch_to_base NAME [SEED]
switch_to_base()
{