diff options
Diffstat (limited to 'builtin-rm.c')
-rw-r--r-- | builtin-rm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/builtin-rm.c b/builtin-rm.c index c11f455858..f3772c84de 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -59,8 +59,7 @@ static int check_local_mod(unsigned char *head, int index_only) if (lstat(ce->name, &st) < 0) { if (errno != ENOENT) - fprintf(stderr, "warning: '%s': %s", - ce->name, strerror(errno)); + warning("'%s': %s", ce->name, strerror(errno)); /* It already vanished from the working tree */ continue; } @@ -158,7 +157,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); - argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0); + argc = parse_options(argc, argv, prefix, builtin_rm_options, + builtin_rm_usage, 0); if (!argc) usage_with_options(builtin_rm_usage, builtin_rm_options); @@ -169,9 +169,10 @@ int cmd_rm(int argc, const char **argv, const char *prefix) if (read_cache() < 0) die("index file corrupt"); - refresh_cache(REFRESH_QUIET); pathspec = get_pathspec(prefix, argv); + refresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL); + seen = NULL; for (i = 0; pathspec[i] ; i++) /* nothing */; @@ -257,7 +258,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix) continue; } if (!removed) - die("git rm: %s: %s", path, strerror(errno)); + die_errno("git rm: '%s'", path); } } |