diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2008-07-21 19:03:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-21 19:11:50 -0700 |
commit | c455c87c5cd42bbbe586b31cea1143132f3a39e4 (patch) | |
tree | 5271cd3b8b7be270c78612047f42ff6fd47e4bbe /builtin-apply.c | |
parent | 51ef1daa4a0dfaa4d777b2fa949ba051cf800554 (diff) | |
download | git-c455c87c5cd42bbbe586b31cea1143132f3a39e4.tar.gz git-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-apply.c')
-rw-r--r-- | builtin-apply.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/builtin-apply.c b/builtin-apply.c index e15471b5b..2216a0bf7 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -12,7 +12,7 @@ #include "blob.h" #include "delta.h" #include "builtin.h" -#include "path-list.h" +#include "string-list.h" /* * --check turns on checking that the working tree matches the @@ -194,7 +194,7 @@ struct image { * the case where more than one patches touch the same file. */ -static struct path_list fn_table; +static struct string_list fn_table; static uint32_t hash_line(const char *cp, size_t len) { @@ -2250,12 +2250,12 @@ static int read_file_or_gitlink(struct cache_entry *ce, struct strbuf *buf) static struct patch *in_fn_table(const char *name) { - struct path_list_item *item; + struct string_list_item *item; if (name == NULL) return NULL; - item = path_list_lookup(name, &fn_table); + item = string_list_lookup(name, &fn_table); if (item != NULL) return (struct patch *)item->util; @@ -2264,7 +2264,7 @@ static struct patch *in_fn_table(const char *name) static void add_to_fn_table(struct patch *patch) { - struct path_list_item *item; + struct string_list_item *item; /* * Always add new_name unless patch is a deletion @@ -2272,7 +2272,7 @@ static void add_to_fn_table(struct patch *patch) * file creations and copies */ if (patch->new_name != NULL) { - item = path_list_insert(patch->new_name, &fn_table); + item = string_list_insert(patch->new_name, &fn_table); item->util = patch; } @@ -2281,7 +2281,7 @@ static void add_to_fn_table(struct patch *patch) * later chunks shouldn't patch old names */ if ((patch->new_name == NULL) || (patch->is_rename)) { - item = path_list_insert(patch->old_name, &fn_table); + item = string_list_insert(patch->old_name, &fn_table); item->util = (struct patch *) -1; } } @@ -3051,7 +3051,7 @@ static int apply_patch(int fd, const char *filename, int options) int skipped_patch = 0; /* FIXME - memory leak when using multiple patch files as inputs */ - memset(&fn_table, 0, sizeof(struct path_list)); + memset(&fn_table, 0, sizeof(struct string_list)); strbuf_init(&buf, 0); patch_input_file = filename; read_patch_file(&buf, fd); |