Skip to content

Commit

Permalink
Merge branch 'js/rerere-forget-always-take-pathspec'
Browse files Browse the repository at this point in the history
* js/rerere-forget-always-take-pathspec:
  rerere forget: deprecate invocation without pathspec
  • Loading branch information
Junio C Hamano committed Mar 20, 2011
2 parents 1e23907 + 5d2c3b0 commit bcd5461
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Documentation/git-rerere.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ git-rerere - Reuse recorded resolution of conflicted merges

SYNOPSIS
--------
'git rerere' ['clear'|'forget' [<pathspec>]|'diff'|'status'|'gc']
'git rerere' ['clear'|'forget' <pathspec>|'diff'|'status'|'gc']

DESCRIPTION
-----------
Expand Down Expand Up @@ -43,7 +43,7 @@ will automatically invoke this command.
'forget' <pathspec>::

This resets the conflict resolutions which rerere has recorded for the current
conflict in <pathspec>. The <pathspec> is optional.
conflict in <pathspec>.

'diff'::

Expand Down
7 changes: 5 additions & 2 deletions builtin/rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "xdiff-interface.h"

static const char * const rerere_usage[] = {
"git rerere [clear | status | remaining | diff | gc]",
"git rerere [clear | forget path... | status | remaining | diff | gc]",
NULL,
};

Expand Down Expand Up @@ -136,7 +136,10 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
return rerere(flags);

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);
}

Expand Down

0 comments on commit bcd5461

Please sign in to comment.