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

[PATCH] Missing quotes

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Apr 21, 2005, 12:45 UTC
Message-ID
<20050421124545.AEED67F898@smurf.noris.de>

gitXnormid.sh should quote its cat-file calls so that nonexisting ssha1 IDs don't result in shell errors.

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>

--- 42a073eb6b5bb397a3e8768a032463a7fa02e6b9/gitXnormid.sh (mode:100755 sha1:c0d53afabe8662ebfc3c697faf08b0a2b43c93f7) +++ 265515f9c4f089b1b61e9d2312c4b3babe189618/gitXnormid.sh (mode:100644 sha1:94710a7a2ab945f1fbd5350cb0de15171ae3f582)

@@ -41,11 +41,11 @@
 	exit 1
 fi
 
-if [ "$type" = "tree" ] && [ $(cat-file -t "$id") = "commit" ]; then
+if [ "$type" = "tree" ] && [ "$(cat-file -t "$id")" = "commit" ]; then
 	id=$(cat-file commit $id | egrep "$TREE" | cut -d ' ' -f 2)
 fi
 
-if [ $(cat-file -t "$id") != "$type" ]; then
+if [ "$(cat-file -t "$id")" != "$type" ]; then
 	echo "Invalid id: $id" >&2
 	exit 1
 fi
Message 1 of 1 in “Missing quotes”
  1. Missing quotesMatthias Urlichs, Apr 21, 2005

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.