summaryrefslogtreecommitdiffstats
path: root/builtin/rerere.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/rerere.c')
-rw-r--r--builtin/rerere.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/builtin/rerere.c b/builtin/rerere.c
index b2efc6f640..f7143c3f5d 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -1,8 +1,9 @@
+#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "parse-options.h"
-#include "repository.h"
+
#include "string-list.h"
#include "rerere.h"
#include "xdiff/xdiff.h"
@@ -48,7 +49,10 @@ static int diff_two(const char *file1, const char *label1,
return ret;
}
-int cmd_rerere(int argc, const char **argv, const char *prefix)
+int cmd_rerere(int argc,
+ const char **argv,
+ const char *prefix,
+ struct repository *repo UNUSED)
{
struct string_list merge_rr = STRING_LIST_INIT_DUP;
int i, autoupdate = -1, flags = 0;
@@ -73,11 +77,17 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
if (!strcmp(argv[0], "forget")) {
struct pathspec pathspec;
+ int ret;
+
if (argc < 2)
warning(_("'git rerere forget' without paths is deprecated"));
parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_CWD,
prefix, argv + 1);
- return rerere_forget(the_repository, &pathspec);
+
+ ret = rerere_forget(the_repository, &pathspec);
+
+ clear_pathspec(&pathspec);
+ return ret;
}
if (!strcmp(argv[0], "clear")) {