chiark / gitweb /
hooks/pre-commit.sh: don't stop commits on non-topgit branches
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 24 Mar 2009 21:16:48 +0000 (22:16 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 24 Mar 2009 21:16:48 +0000 (22:16 +0100)
This is a regression introduced by c32d1dd4fcafad3f9c570adeda580a90d56

"${head_#refs/heads/#refs/top-bases#}" doesn't substitute refs/heads by
refs/top-bases, but strips the prefix of $head_ if it starts with
"refs/heads/#refs/top-bases#".

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
hooks/pre-commit.sh

index 52d201e6c490c5fa0e5e29667253062421f34618..a12cfa6dec2797d1e97f23b665951035ae9df09e 100644 (file)
@@ -20,7 +20,7 @@ tg_util
 if head_=$(git symbolic-ref -q HEAD); then
        case "$head_" in
                refs/heads/*)
-                       git rev-parse -q --verify "${head_#refs/heads/#refs/top-bases#}" >/dev/null || exit 0;;
+                       git rev-parse -q --verify "${head_/#refs\/heads/refs\/top-bases}" >/dev/null || exit 0;;
                *)
                        exit 0;;
        esac