+branch_annihilated()
+{
+ _name="$1";
+
+ # use the merge base in case the base is ahead.
+ mb="$(git merge-base "refs/top-bases/$_name" "$_name")";
+
+ test "$(git rev-parse "$mb^{tree}")" = "$(git rev-parse "$_name^{tree}")";
+}
+
+# is_sha1 REF
+# Whether REF is a SHA1 (compared to a symbolic name).
+is_sha1()
+{
+ [ "$(git rev-parse "$1")" = "$1" ]
+}
+