diff --git a/builtin-apply.c b/builtin-apply.c
index 2ab4aba5a07727fa6368c6acc9b851830a9c24f3..e2c611bf964d8cd589171f74e5ccce5aeb392643 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
#include "delta.h"
#include "builtin.h"
#include "string-list.h"
#include "delta.h"
#include "builtin.h"
#include "string-list.h"
+#include "dir.h"
/*
* --check turns on checking that the working tree matches the
/*
* --check turns on checking that the working tree matches the
warning("unable to remove submodule %s",
patch->old_name);
} else if (!unlink(patch->old_name) && rmdir_empty) {
warning("unable to remove submodule %s",
patch->old_name);
} else if (!unlink(patch->old_name) && rmdir_empty) {
- char *name = xstrdup(patch->old_name);
- char *end = strrchr(name, '/');
- while (end) {
- *end = 0;
- if (rmdir(name))
- break;
- end = strrchr(name, '/');
- }
- free(name);
+ remove_path(patch->old_name);
}
}
}
}
}
}