# [PATCH] cg-commit -p tries to remove a non-existent file

1 messages from 2006-06-01 to 2006-06-01. Participants: Dennis Stosberg.
Thread: https://gitlist.dev/t/4368

## Dennis Stosberg, 2006-06-01 15:14

Subject: [PATCH] cg-commit -p tries to remove a non-existent file
Message-ID: <20060601151427.G51985817@leonov.stosberg.net>
URL: https://gitlist.dev/e/20060601151427.G51985817%40leonov.stosberg.net

```
This produces an error message when the user aborts the commit:

$ cg init -m "Initial commit"
$ echo "some text" >file
$ cg add file
$ EDITOR=/bin/false cg commit -p
Log message unchanged or not specified
Abort or commit? [ac] a
rm: cannot remove `/tmp/gitci.zdAHil/patch2.diff': No such file or \
directory
Commit message not modified, commit aborted
---
 cg-commit |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-commit b/cg-commit
index 4ec2b33..c636b1a 100755
--- a/cg-commit
+++ b/cg-commit
@@ -442,7 +442,7 @@ cp "$LOGMSG" "$LOGMSG2"
 if tty -s; then
 	if [ "$editor" ] && ! editor $commitalways commit c; then
 		rm "$LOGMSG" "$LOGMSG2"
-		[ "$review" ] && rm "$PATCH" "$PATCH2"
+		[ "$review" ] && rm "$PATCH"
 		echo "Commit message not modified, commit aborted" >&2
 		if [ "$merging" ]; then
 			cat >&2 <<__END__
-- 
1.3.3+git20060531-dest1

```
