diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-12-17 19:43:06 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-03 14:08:30 -0800 |
commit | afe069d16618190a6f7e84ef8451970e274aedb4 (patch) | |
tree | 6e0e2b1aa98b8a576177a3804032974c76e21b26 /builtin | |
parent | 61cf28204508c095a68e7a9cb6307ca2a27112c9 (diff) | |
download | git-afe069d16618190a6f7e84ef8451970e274aedb4.tar.gz git-afe069d16618190a6f7e84ef8451970e274aedb4.tar.xz |
struct rev_info: convert prune_data to struct pathspec
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/add.c | 2 | ||||
-rw-r--r-- | builtin/diff.c | 12 | ||||
-rw-r--r-- | builtin/fast-export.c | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/builtin/add.c b/builtin/add.c index 12b964e64..5f817ad77 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -86,7 +86,7 @@ int add_files_to_cache(const char *prefix, const char **pathspec, int flags) struct rev_info rev; init_revisions(&rev, prefix); setup_revisions(0, NULL, &rev, NULL); - rev.prune_data = pathspec; + init_pathspec(&rev.prune_data, pathspec); rev.diffopt.output_format = DIFF_FORMAT_CALLBACK; rev.diffopt.format_callback = update_callback; data.flags = flags; diff --git a/builtin/diff.c b/builtin/diff.c index a08c3240d..d12de8f39 100644 --- a/builtin/diff.c +++ b/builtin/diff.c @@ -371,14 +371,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; } /* diff --git a/builtin/fast-export.c b/builtin/fast-export.c index c8fd46b87..ba57457cc 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -651,7 +651,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix) if (import_filename) import_marks(import_filename); - if (import_filename && revs.prune_data) + if (import_filename && revs.prune_data.nr) full_tree = 1; get_tags_and_duplicates(&revs.pending, &extra_refs); |