summaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-07-21 18:03:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-22 02:11:50 (GMT)
commitc455c87c5cd42bbbe586b31cea1143132f3a39e4 (patch)
tree5271cd3b8b7be270c78612047f42ff6fd47e4bbe /builtin-commit.c
parent51ef1daa4a0dfaa4d777b2fa949ba051cf800554 (diff)
downloadgit-c455c87c5cd42bbbe586b31cea1143132f3a39e4.zip
git-c455c87c5cd42bbbe586b31cea1143132f3a39e4.tar.gz
git-c455c87c5cd42bbbe586b31cea1143132f3a39e4.tar.bz2
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-commit.c')
-rw-r--r--builtin-commit.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index ed3fe3f..97e64de 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -21,7 +21,7 @@
#include "strbuf.h"
#include "utf8.h"
#include "parse-options.h"
-#include "path-list.h"
+#include "string-list.h"
#include "rerere.h"
#include "unpack-trees.h"
@@ -150,7 +150,7 @@ static int commit_index_files(void)
* Take a union of paths in the index and the named tree (typically, "HEAD"),
* and return the paths that match the given pattern in list.
*/
-static int list_paths(struct path_list *list, const char *with_tree,
+static int list_paths(struct string_list *list, const char *with_tree,
const char *prefix, const char **pattern)
{
int i;
@@ -169,24 +169,24 @@ static int list_paths(struct path_list *list, const char *with_tree,
continue;
if (!pathspec_match(pattern, m, ce->name, 0))
continue;
- path_list_insert(ce->name, list);
+ string_list_insert(ce->name, list);
}
return report_path_error(m, pattern, prefix ? strlen(prefix) : 0);
}
-static void add_remove_files(struct path_list *list)
+static void add_remove_files(struct string_list *list)
{
int i;
for (i = 0; i < list->nr; i++) {
struct stat st;
- struct path_list_item *p = &(list->items[i]);
+ struct string_list_item *p = &(list->items[i]);
- if (!lstat(p->path, &st)) {
- if (add_to_cache(p->path, &st, 0))
+ if (!lstat(p->string, &st)) {
+ if (add_to_cache(p->string, &st, 0))
die("updating files failed");
} else
- remove_file_from_cache(p->path);
+ remove_file_from_cache(p->string);
}
}
@@ -221,7 +221,7 @@ static void create_base_index(void)
static char *prepare_index(int argc, const char **argv, const char *prefix)
{
int fd;
- struct path_list partial;
+ struct string_list partial;
const char **pathspec = NULL;
if (interactive) {
@@ -305,7 +305,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix)
die("cannot do a partial commit during a merge.");
memset(&partial, 0, sizeof(partial));
- partial.strdup_paths = 1;
+ partial.strdup_strings = 1;
if (list_paths(&partial, initial_commit ? NULL : "HEAD", prefix, pathspec))
exit(1);