threads / patch / 858

patchfix cg-commit new file handling

Subject: [PATCH] fix cg-commit new file handling

## tl;dr

One message between Jun 8, 2005 and Jun 8, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Eugene Surovegin· Jun 8, 2005, 05:59 UTC · lore
Hi!

There is a problem with committing new files with the current cogito version.

I got an error like this: 
  fatal: Unable to add arch/ppc/kernel/dcr.S to database

I think this is caused by the incorrect file list parsing in cg-commit precommit_update(): it expects new files prefixed with "A", while they are prefixed with "N".

The following trivial patch fixes this.
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
Show changes to cg-commit +1 −1
diff --git a/cg-commit b/cg-commit
--- a/cg-commit
+++ b/cg-commit
@@ -227,7 +227,7 @@ precommit_update () {
 	for file in "$@"; do
 		op=${file%% *}
 		fname=${file#* }
-		[ "$op" = "A" ] || [ "$op" = "D" ] || [ "$op" = "M" ] || op=M
+		[ "$op" = "N" ] || [ "$op" = "D" ] || [ "$op" = "M" ] || op=M
 		eval "queue$op[\${#queue$op[@]}]=\"\$fname\""
 	done
 	# XXX: Do we even need to do the --add and --remove update-caches?

← back to recent threads