aboutsummaryrefslogtreecommitdiff
path: root/builtin/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-27 21:17:36 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-27 21:17:36 -0800
commitd5c87a802d3b0bcd37b38d117648f342e7ad62d2 (patch)
tree531cdac203249d777d555209dadab103a16925a5 /builtin/diff.c
parente5ea66f9e545588c92cf228cca16f0b52d467bb5 (diff)
parentf577b92fe75643228674c0dcb2a4747587cf541d (diff)
downloadgit-d5c87a802d3b0bcd37b38d117648f342e7ad62d2.tar.gz
git-d5c87a802d3b0bcd37b38d117648f342e7ad62d2.tar.xz
Merge branch 'nd/struct-pathspec'
* nd/struct-pathspec: (22 commits) t6004: add pathspec globbing test for log family t7810: overlapping pathspecs and depth limit grep: drop pathspec_matches() in favor of tree_entry_interesting() grep: use writable strbuf from caller for grep_tree() grep: use match_pathspec_depth() for cache/worktree grepping grep: convert to use struct pathspec Convert ce_path_match() to use match_pathspec_depth() Convert ce_path_match() to use struct pathspec struct rev_info: convert prune_data to struct pathspec pathspec: add match_pathspec_depth() tree_entry_interesting(): optimize wildcard matching when base is matched tree_entry_interesting(): support wildcard matching tree_entry_interesting(): fix depth limit with overlapping pathspecs tree_entry_interesting(): support depth limit tree_entry_interesting(): refactor into separate smaller functions diff-tree: convert base+baselen to writable strbuf glossary: define pathspec Move tree_entry_interesting() to tree-walk.c and export it tree_entry_interesting(): remove dependency on struct diff_options Convert struct diff_options to use struct pathspec ...
Diffstat (limited to 'builtin/diff.c')
-rw-r--r--builtin/diff.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 42822cd53..4c9deb28e 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -135,7 +135,7 @@ static int builtin_diff_index(struct rev_info *revs,
revs->max_count != -1 || revs->min_age != -1 ||
revs->max_age != -1)
usage(builtin_diff_usage);
- if (read_cache_preload(revs->diffopt.paths) < 0) {
+ if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
perror("read_cache_preload");
return -1;
}
@@ -237,7 +237,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
revs->combine_merges = revs->dense_combined_merges = 1;
setup_work_tree();
- if (read_cache_preload(revs->diffopt.paths) < 0) {
+ if (read_cache_preload(revs->diffopt.pathspec.raw) < 0) {
perror("read_cache_preload");
return -1;
}
@@ -374,14 +374,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
}
die("unhandled object '%s' given.", name);
}
- if (rev.prune_data) {
- const char **pathspec = rev.prune_data;
- while (*pathspec) {
- if (!path)
- path = *pathspec;
- paths++;
- pathspec++;
- }
+ if (rev.prune_data.nr) {
+ if (!path)
+ path = rev.prune_data.items[0].match;
+ paths += rev.prune_data.nr;
}
/*