diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-19 16:59:29 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-19 16:59:29 -0700 |
commit | edd5cc242820f3eec26329a263e4016a039adee1 (patch) | |
tree | e1b056b9e87491920904d9f134a3f5579a15a900 | |
parent | 667661d46ef3de6ec38d915f048b4008c0b7c27d (diff) | |
parent | d91d4c2c500b17d50359693a406a2c68b65330fe (diff) | |
download | git-edd5cc242820f3eec26329a263e4016a039adee1.tar.gz git-edd5cc242820f3eec26329a263e4016a039adee1.tar.xz |
Merge branch 'jc/apply'
* jc/apply:
apply --cached: do not check newly added file in the working tree
-rw-r--r-- | apply.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1711,10 +1711,12 @@ static int check_patch(struct patch *patch) if (new_name && (patch->is_new | patch->is_rename | patch->is_copy)) { if (check_index && cache_name_pos(new_name, strlen(new_name)) >= 0) return error("%s: already exists in index", new_name); - if (!cached && !lstat(new_name, &st)) - return error("%s: already exists in working directory", new_name); - if (errno != ENOENT) - return error("%s: %s", new_name, strerror(errno)); + if (!cached) { + if (!lstat(new_name, &st)) + return error("%s: already exists in working directory", new_name); + if (errno != ENOENT) + return error("%s: %s", new_name, strerror(errno)); + } if (!patch->new_mode) { if (patch->is_new) patch->new_mode = S_IFREG | 0644; |