threads / patch / 7049

patchFix quoting in update hook template

Subject: [PATCH] Fix quoting in update hook template

## tl;dr

One message between Mar 2, 2007 and Mar 2, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Gerrit Pape· Mar 2, 2007, 12:20 UTC · lore

By default allowunannotated is unset in the repo config, hence $allowunannotated is empty, and must be quoted to not break the syntax.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 templates/hooks--update |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to templates/hooks--update +1 −1
diff --git a/templates/hooks--update b/templates/hooks--update
index fd1f73d..170a4de 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -64,7 +64,7 @@ case "$refname","$newrev_type" in
 		# un-annotated tag
 		refname_type="tag"
 		short_refname=${refname##refs/tags/}
-		if [ $allowunannotated != "true" ]; then
+		if [ "$allowunannotated" != "true" ]; then
 			echo "*** The un-annotated tag, $short_refname is not allowed in this repository" >&2
 			echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
 			exit 1
-- 
1.5.0.1

← back to recent threads