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

[PATCH] Fix cg-commit to handle files with leading '-'

From
Jonas Fonseca <fonseca@diku.dk>
Date
May 11, 2005, 00:55 UTC
Message-ID
<20050511005525.GB3055@diku.dk>
Hi Pasky,

cg-commit dies with "update-cache failed" message when adding files beginning with a '-' because the '--' arg is missing.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
-- 
Jonas Fonseca


Index: cg-commit
===================================================================
--- 673ad20e23591a8e5bdf18a755a5dea1755b7bf6/cg-commit  (mode:100755)
+++ uncommitted/cg-commit  (mode:100755)
@@ -140,13 +140,13 @@
 
 if [ ! "$ignorecache" ]; then
 	if [ "$customfiles" ]; then
-		git-update-cache --add --remove "${commitfiles[@]}" \
+		git-update-cache --add --remove -- "${commitfiles[@]}" \
 			|| die "update-cache failed"
 		export GIT_INDEX_FILE=$(mktemp -t gitci.XXXXXX)
 		git-read-tree HEAD
 	fi
 	# TODO: Do the proper separation of adds, removes, and changes.
-	git-update-cache --add --remove "${commitfiles[@]}" \
+	git-update-cache --add --remove -- "${commitfiles[@]}" \
 		|| die "update-cache failed"
 fi
 
Message 1 of 1 in “Fix cg-commit to handle files with leading '-'”
  1. Fix cg-commit to handle files with leading '-'Jonas Fonseca, May 11, 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.