git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix quoting in update hook template

From
Gerrit Pape <pape@smarden.org>
Date
Mar 2, 2007, 12:20 UTC
Message-ID
<20070302122010.5110.qmail@fa54d807064c75.315fe32.mid.smarden.org>

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(-)
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
Message 1 of 1 in “Fix quoting in update hook template”
  1. Fix quoting in update hook templateGerrit Pape, Mar 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.