X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rm.c;h=00dbe399609051647f393e0c543a862a0ba432c8;hb=a8c40471ab0851bf9a58f7dc76f121258e0690e2;hp=5b078c41943c9ce0ff1983896e8ad6ae38705f60;hpb=6ec45f3bd180ed0404733d0f5c648691245cf571;p=git.git diff --git a/builtin-rm.c b/builtin-rm.c index 5b078c419..00dbe3996 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -10,7 +10,7 @@ #include "tree-walk.h" static const char builtin_rm_usage[] = -"git-rm [-n] [-f] [--cached] ..."; +"git-rm [-f] [-n] [-r] [--cached] [--] ..."; static struct { int nr, alloc; @@ -32,6 +32,10 @@ static int remove_file(const char *name) char *slash; ret = unlink(name); + if (ret && errno == ENOENT) + /* The user has removed it from the filesystem by hand */ + ret = errno = 0; + if (!ret && (slash = strrchr(name, '/'))) { char *n = xstrdup(name); do { @@ -204,7 +208,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) return 0; /* - * Then, unless we used "--cache", remove the filenames from + * Then, unless we used "--cached", remove the filenames from * the workspace. If we fail to remove the first one, we * abort the "git rm" (but once we've successfully removed * any file at all, we'll go ahead and commit to it all: