Merge branch 'js/rerere-forget-always-take-pathspec'

* js/rerere-forget-always-take-pathspec:
  rerere forget: deprecate invocation without pathspec
This commit is contained in:
Junio C Hamano 2011-03-19 23:24:48 -07:00
commit bcd5461a35
2 changed files with 7 additions and 4 deletions

View File

@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
SYNOPSIS SYNOPSIS
-------- --------
'git rerere' ['clear'|'forget' [<pathspec>]|'diff'|'status'|'gc'] 'git rerere' ['clear'|'forget' <pathspec>|'diff'|'status'|'gc']
DESCRIPTION DESCRIPTION
----------- -----------
@ -43,7 +43,7 @@ will automatically invoke this command.
'forget' <pathspec>:: 'forget' <pathspec>::
This resets the conflict resolutions which rerere has recorded for the current This resets the conflict resolutions which rerere has recorded for the current
conflict in <pathspec>. The <pathspec> is optional. conflict in <pathspec>.
'diff':: 'diff'::

View File

@ -8,7 +8,7 @@
#include "xdiff-interface.h" #include "xdiff-interface.h"
static const char * const rerere_usage[] = { static const char * const rerere_usage[] = {
"git rerere [clear | status | remaining | diff | gc]", "git rerere [clear | forget path... | status | remaining | diff | gc]",
NULL, NULL,
}; };
@ -136,7 +136,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
return rerere(flags); return rerere(flags);
if (!strcmp(argv[0], "forget")) { if (!strcmp(argv[0], "forget")) {
const char **pathspec = get_pathspec(prefix, argv + 1); const char **pathspec;
if (argc < 2)
warning("'git rerere forget' without paths is deprecated");
pathspec = get_pathspec(prefix, argv + 1);
return rerere_forget(pathspec); return rerere_forget(pathspec);
} }