Merge branch 'js/refer-upstream'
[gitweb.git] / builtin-rm.c
index 0cc491271846214d73d55a4f528c8854e0460c8f..f3772c84de0a1f1a18123e55ae6e6983739f590b 100644 (file)
@@ -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);
                }
        }