t5520: test --rebase failure on unborn branch with index
[gitweb.git] / builtin / rerere.c
index dc1708e6d6de54b5aaec36d5ff4242bd60183f0a..98eb8c5404914e4046fdb886866b611351deeacf 100644 (file)
@@ -6,6 +6,7 @@
 #include "rerere.h"
 #include "xdiff/xdiff.h"
 #include "xdiff-interface.h"
+#include "pathspec.h"
 
 static const char * const rerere_usage[] = {
        N_("git rerere [clear | forget path... | status | remaining | diff | gc]"),
@@ -59,6 +60,8 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
 
        argc = parse_options(argc, argv, prefix, options, rerere_usage, 0);
 
+       git_config(git_xmerge_config, NULL);
+
        if (autoupdate == 1)
                flags = RERERE_AUTOUPDATE;
        if (autoupdate == 0)
@@ -68,11 +71,12 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
                return rerere(flags);
 
        if (!strcmp(argv[0], "forget")) {
-               const char **pathspec;
+               struct pathspec pathspec;
                if (argc < 2)
                        warning("'git rerere forget' without paths is deprecated");
-               pathspec = get_pathspec(prefix, argv + 1);
-               return rerere_forget(pathspec);
+               parse_pathspec(&pathspec, 0, PATHSPEC_PREFER_CWD,
+                              prefix, argv + 1);
+               return rerere_forget(&pathspec);
        }
 
        fd = setup_rerere(&merge_rr, flags);