Skip to contentSkip to conversation

Fix cg-commit to handle files with leading '-'

PATCH New Jonas Fonseca 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix cg-commit to handle files with leading '-'

Hi Pasky,

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

Signature · 1 line
Jonas Fonseca
cg-commit (mode:100755) +2 -2
Index: cg-commit
===================================================================
@@ -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