#include "builtin.h"
#include "cache.h"
-#include "path-list.h"
+#include "string-list.h"
#include "rerere.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
static const char git_rerere_usage[] =
-"git-rerere [clear | status | diff | gc]";
+"git rerere [clear | status | diff | gc]";
/* these values are days */
static int cutoff_noresolve = 15;
return 0;
}
-static void garbage_collect(struct path_list *rr)
+static void garbage_collect(struct string_list *rr)
{
- struct path_list to_remove = { NULL, 0, 0, 1 };
+ struct string_list to_remove = { NULL, 0, 0, 1 };
DIR *dir;
struct dirent *e;
int i, cutoff;
cutoff = (has_resolution(name)
? cutoff_resolve : cutoff_noresolve);
if (then < now - cutoff * 86400)
- path_list_append(name, &to_remove);
+ string_list_append(name, &to_remove);
}
for (i = 0; i < to_remove.nr; i++)
- unlink_rr_item(to_remove.items[i].path);
- path_list_clear(&to_remove, 0);
+ unlink_rr_item(to_remove.items[i].string);
+ string_list_clear(&to_remove, 0);
}
static int outf(void *dummy, mmbuffer_t *ptr, int nbuf)
printf("--- a/%s\n+++ b/%s\n", label1, label2);
fflush(stdout);
+ memset(&xpp, 0, sizeof(xpp));
xpp.flags = XDF_NEED_MINIMAL;
memset(&xecfg, 0, sizeof(xecfg));
xecfg.ctxlen = 3;
int cmd_rerere(int argc, const char **argv, const char *prefix)
{
- struct path_list merge_rr = { NULL, 0, 0, 1 };
+ struct string_list merge_rr = { NULL, 0, 0, 1 };
int i, fd;
if (argc < 2)
garbage_collect(&merge_rr);
else if (!strcmp(argv[1], "status"))
for (i = 0; i < merge_rr.nr; i++)
- printf("%s\n", merge_rr.items[i].path);
+ printf("%s\n", merge_rr.items[i].string);
else if (!strcmp(argv[1], "diff"))
for (i = 0; i < merge_rr.nr; i++) {
- const char *path = merge_rr.items[i].path;
+ const char *path = merge_rr.items[i].string;
const char *name = (const char *)merge_rr.items[i].util;
diff_two(rr_path(name, "preimage"), path, path, path);
}
else
usage(git_rerere_usage);
- path_list_clear(&merge_rr, 1);
+ string_list_clear(&merge_rr, 1);
return 0;
}