"git cmd :" should be exactly the same as running "git cmd" from the root level of the working tree. Do not decide solely on the value of argc (i.e. remaining parameters after options and revs are parsed) to see if the user limited the operation with paths. Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx> --- builtin/rm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/builtin/rm.c b/builtin/rm.c index ff491d7..c31f915 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -162,11 +162,13 @@ int cmd_rm(int argc, const char **argv, const char *prefix) die("index file corrupt"); pathspec = get_pathspec(prefix, argv); + if (!pathspec) + die("removing nothing?"); refresh_index(&the_index, REFRESH_QUIET, pathspec, NULL, NULL); seen = NULL; for (i = 0; pathspec[i] ; i++) - /* nothing */; + ; /* nothing */ seen = xcalloc(i, 1); for (i = 0; i < active_nr; i++) { -- 1.7.5.1.290.g1b565 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html