Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 12:35:57 +0400
committerJunio C Hamano <gitster@pobox.com>2013-07-15 21:56:09 +0400
commit827f4d6c218448d58f934c0980b6366407261b74 (patch)
treed6a874c90a050d79cca5a20d7bd61422eb8687c0 /builtin
parent3efe8e43813c859b78796b985a4fc06c2c153fb4 (diff)
convert common_prefix() to use struct pathspec
The code now takes advantage of nowildcard_len field. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c2
-rw-r--r--builtin/ls-files.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 3b4dd60312..4ee9ba6c63 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -199,7 +199,7 @@ static int list_paths(struct string_list *list, const char *with_tree,
m = xcalloc(1, pattern->nr);
if (with_tree) {
- char *max_prefix = common_prefix(pattern->raw);
+ char *max_prefix = common_prefix(pattern);
overlay_tree_on_cache(with_tree, max_prefix ? max_prefix : prefix);
free(max_prefix);
}
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index fa1a6bec01..c074e6fc7c 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -546,7 +546,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
prefix, argv);
/* Find common prefix for all pathspec's */
- max_prefix = common_prefix(pathspec.raw);
+ max_prefix = common_prefix(&pathspec);
max_prefix_len = max_prefix ? strlen(max_prefix) : 0;
/* Treat unmatching pathspec elements as errors */