summaryrefslogtreecommitdiff
path: root/builtin-rerere.c
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <Johannes.Schindelin@gmx.de>2008-07-21 19:03:49 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-07-21 19:11:50 -0700
commitc455c87c5cd42bbbe586b31cea1143132f3a39e4 (patch)
tree5271cd3b8b7be270c78612047f42ff6fd47e4bbe /builtin-rerere.c
parentRename .git/rebase to .git/rebase-apply (diff)
downloadtgif-c455c87c5cd42bbbe586b31cea1143132f3a39e4.tar.xz
Rename path_list to string_list
The name path_list was correct for the first usage of that data structure, but it really is a general-purpose string list. $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list) $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list) $ git mv path-list.h string-list.h $ git mv path-list.c string-list.c $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path) $ perl -i -pe 's/path/string/g' string-list.[ch] $ git mv Documentation/technical/api-path-list.txt \ Documentation/technical/api-string-list.txt $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths) ... and then fix all users of string-list to access the member "string" instead of "path". Documentation/technical/api-string-list.txt needed some rewrapping, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-rerere.c')
-rw-r--r--builtin-rerere.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 580580502c..dd4573fe8d 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -1,6 +1,6 @@
#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"
@@ -48,9 +48,9 @@ static int git_rerere_gc_config(const char *var, const char *value, void *cb)
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;
@@ -69,11 +69,11 @@ static void garbage_collect(struct path_list *rr)
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)
@@ -111,7 +111,7 @@ static int diff_two(const char *file1, const char *label1,
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)
@@ -132,16 +132,16 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
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;
}