tg-delete: simplistic check for dependency on deleted branch
authorAndrey Borzenkov <arvidjaar@gmail.com>
Fri, 18 Mar 2011 22:40:32 +0000 (19 01:40 +0300)
committerAndrey Borzenkov <arvidjaar@gmail.com>
Fri, 18 Mar 2011 22:40:32 +0000 (19 01:40 +0300)
tg-delete.sh

index e1eea17..64d2057 100644 (file)
@@ -40,6 +40,8 @@ baserev="$(git rev-parse --verify "refs/top-bases/$name" 2>/dev/null)" ||
 
 [ -z "$force" ] && { branch_empty "$name" || die "branch is non-empty: $name"; }
 
+# Quick'n'dirty check whether branch is required
+[ -z "$force" ] && { tg summary --deps | cut -d' ' -f2- | tr ' ' '\n' | fgrep -xq -- "$name" && die "some branch depends on $name"; }
 
 ## Wipe out