diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:30:38 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-22 08:30:38 -0700 |
commit | 21919d396a3a05ccb8d6b538b246500f01585bb7 (patch) | |
tree | 0b7d4710abcdb0b637557808064cd40bc3b72da6 /unpack-trees.c | |
parent | e0ae1e6f4d53c68bd219385f6f309c033d0fc673 (diff) | |
parent | 25755e842f814751fbdb7abfc8255a40f24bfaa3 (diff) | |
download | git-21919d396a3a05ccb8d6b538b246500f01585bb7.tar.gz git-21919d396a3a05ccb8d6b538b246500f01585bb7.tar.xz |
Merge branch 'pc/remove-warn' into maint
* 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 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 1a8030ced..490cd5f6f 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -67,16 +67,8 @@ static void unlink_entry(struct cache_entry *ce) { if (has_symlink_or_noent_leading_path(ce->name, ce_namelen(ce))) return; - if (S_ISGITLINK(ce->ce_mode)) { - if (rmdir(ce->name)) { - warning("unable to rmdir %s: %s", - ce->name, strerror(errno)); - return; - } - } - else - if (unlink_or_warn(ce->name)) - return; + if (remove_or_warn(ce->ce_mode, ce->name)) + return; schedule_dir_for_removal(ce->name, ce_namelen(ce)); } |