diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-03-25 16:34:19 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-25 09:20:33 -0700 |
commit | f0096c06bcdeb7aa6ae8a749ddc9d6d4a2c381d1 (patch) | |
tree | b5b28251c9e48186b9e6168cbfefe4ace0f57602 /builtin/log.c | |
parent | ffd31f661d5c5dddc091750ca86cfaa5d9d04b38 (diff) | |
download | git-f0096c06bcdeb7aa6ae8a749ddc9d6d4a2c381d1.tar.gz |
Convert read_tree{,_recursive} to support struct pathspec
This patch changes behavior of the two functions. Previously it does
prefix matching only. Now it can also do wildcard matching.
All callers are updated. Some gain wildcard matching (archive,
checkout), others reset pathspec_item.has_wildcard to retain old
behavior (ls-files, ls-tree as they are plumbing).
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/log.c')
-rw-r--r-- | builtin/log.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c index f5ed690c43..e6bbcecda2 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -390,6 +390,7 @@ int cmd_show(int argc, const char **argv, const char *prefix) struct rev_info rev; struct object_array_entry *objects; struct setup_revision_opt opt; + struct pathspec match_all; int i, count, ret = 0; git_config(git_log_config, NULL); @@ -397,6 +398,7 @@ int cmd_show(int argc, const char **argv, const char *prefix) if (diff_use_color_default == -1) diff_use_color_default = git_use_color_default; + init_pathspec(&match_all, NULL); init_revisions(&rev, prefix); rev.diff = 1; rev.always_show_header = 1; @@ -443,7 +445,7 @@ int cmd_show(int argc, const char **argv, const char *prefix) diff_get_color_opt(&rev.diffopt, DIFF_COMMIT), name, diff_get_color_opt(&rev.diffopt, DIFF_RESET)); - read_tree_recursive((struct tree *)o, "", 0, 0, NULL, + read_tree_recursive((struct tree *)o, "", 0, 0, &match_all, show_tree_object, NULL); rev.shown_one = 1; break; |