Skip to content

Commit

Permalink
When the patch tries to create a new file and the file exists, abort.
Browse files Browse the repository at this point in the history
This fixes an error introduced to git-apply-patch-script in the previous
round.  We do not invoke patch for create/delete case, so we need to
be a bit careful about detecting conflicts like this.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed May 4, 2005
1 parent b46f0b6 commit 8a9d32b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git-apply-patch-script
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ case "$mode1,$mode2" in
echo >&2 "cannot create leading path for $name."
exit 1
}
if test -f "$name"
then
echo >&2 "file $name to be created already exists."
exit 1
fi
cat "$tmp2" >"$name" || {
echo >&2 "cannot create $name."
exit 1
}
case "$mode2" in
+x)
echo >&2 "created $name with mode +x."
Expand Down

0 comments on commit 8a9d32b

Please sign in to comment.