]> asedeno.scripts.mit.edu Git - git.git/blobdiff - wrapper.c
Merge branch 'sr/remote-helper-export'
[git.git] / wrapper.c
index 0bbff56e2c38651b10551d17caeed84e0cc250c8..10a6750795b287beabd50561402ffa8867f3e283 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -328,3 +328,13 @@ int unlink_or_warn(const char *file)
 {
        return warn_if_unremovable("unlink", file, unlink(file));
 }
+
+int rmdir_or_warn(const char *file)
+{
+       return warn_if_unremovable("rmdir", file, rmdir(file));
+}
+
+int remove_or_warn(unsigned int mode, const char *file)
+{
+       return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
+}