chiark / gitweb /
hooks/pre-commit: check .topdeps for valid branches
authorBert Wesarg <bert.wesarg@googlemail.com>
Mon, 4 Oct 2010 21:18:50 +0000 (23:18 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 5 Oct 2010 07:04:35 +0000 (09:04 +0200)
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
hooks/pre-commit.sh

index b6361c52a024e58721ddda8275f3a7d56ce524f5..6dbe82cb3c211cbf82ba3c722d9f748064cc6960 100644 (file)
@@ -78,6 +78,9 @@ BEGIN      { in_hunk = 0; }
 /^[^@ +-]/ { in_hunk = 0; }
 ' |
        while read newly_added; do
+               ref_exists "$newly_added" ||
+                       die "Invalid branch as dependent: $newly_added"
+
                # check for self as dep
                [ "$head_" != "$newly_added" ] ||
                        die "Can't have myself as dep"
@@ -90,6 +93,3 @@ BEGIN      { in_hunk = 0; }
                # therefore no endless loop in the cycle-check
                no_remotes=1 recurse_deps check_cycle_name "$newly_added"
        done
-
-
-# TODO: Verify .topdeps for valid branch names