diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-05-08 22:32:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-08 22:32:59 -0700 |
commit | 3ecaa3b6a5f707617ea610d727c696f43f8b2f0b (patch) | |
tree | 092dc9814e12b70ae637c26e36e5d0e6813657b4 /builtin | |
parent | 43acff34b902c38808ac0f326090f2516250e1f0 (diff) | |
parent | 25755e842f814751fbdb7abfc8255a40f24bfaa3 (diff) | |
download | git-3ecaa3b6a5f707617ea610d727c696f43f8b2f0b.tar.gz git-3ecaa3b6a5f707617ea610d727c696f43f8b2f0b.tar.xz |
Merge branch 'pc/remove-warn'
* pc/remove-warn:
Remove a redundant errno test in a usage of remove_path
Introduce remove_or_warn function
Implement the rmdir_or_warn function
Generalise the unlink_or_warn function
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/apply.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/builtin/apply.c b/builtin/apply.c index 771c972c5..660cf9253 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -3141,11 +3141,7 @@ static void remove_file(struct patch *patch, int rmdir_empty) die("unable to remove %s from index", patch->old_name); } if (!cached) { - if (S_ISGITLINK(patch->old_mode)) { - if (rmdir(patch->old_name)) - warning("unable to remove submodule %s", - patch->old_name); - } else if (!unlink_or_warn(patch->old_name) && rmdir_empty) { + if (!remove_or_warn(patch->old_mode, patch->old_name) && rmdir_empty) { remove_path(patch->old_name); } } |