aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-07-14 15:35:57 +0700
committerJunio C Hamano <gitster@pobox.com>2013-07-15 10:56:09 -0700
commit827f4d6c218448d58f934c0980b6366407261b74 (patch)
treed6a874c90a050d79cca5a20d7bd61422eb8687c0 /builtin
parent3efe8e43813c859b78796b985a4fc06c2c153fb4 (diff)
downloadgit-827f4d6c218448d58f934c0980b6366407261b74.tar.gz
git-827f4d6c218448d58f934c0980b6366407261b74.tar.xz
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 3b4dd6031..4ee9ba6c6 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 fa1a6bec0..c074e6fc7 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 */