summaryrefslogtreecommitdiff
path: root/builtin-apply.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-18 16:17:28 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-18 16:17:28 -0700
commit6fb8e8f401a065bdffe379764871551e37a041a0 (patch)
tree96f41d575c40cecd61f20254c327c3a03fc7044b /builtin-apply.c
parentabbf594763a14e9c00c61f688e45bed636f1eb52 (diff)
parent0ad64fd0b8d073e0c73836858a54f693c9191918 (diff)
downloadgit-6fb8e8f401a065bdffe379764871551e37a041a0.tar.gz
Merge branch 'maint'
* maint: git-shortlog: Fix two formatting errors in asciidoc documentation Fix overwriting of files when applying contextually independent diffs git-svn: don't allow globs to match regular files
Diffstat (limited to 'builtin-apply.c')
-rw-r--r--builtin-apply.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin-apply.c b/builtin-apply.c
index fd92ef7174..94311e7af4 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -2416,8 +2416,7 @@ static void create_one_file(char *path, unsigned mode, const char *buf, unsigned
* used to be.
*/
struct stat st;
- errno = 0;
- if (!lstat(path, &st) && S_ISDIR(st.st_mode) && !rmdir(path))
+ if (!lstat(path, &st) && (!S_ISDIR(st.st_mode) || !rmdir(path)))
errno = EEXIST;
}