diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-12-17 19:43:07 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-03 14:08:30 -0800 |
commit | eb9cb55b944796374402ab4e2639300dc9b0b409 (patch) | |
tree | f240f3713f75d196a320b19f3ace7c570fec6cd4 /builtin/update-index.c | |
parent | afe069d16618190a6f7e84ef8451970e274aedb4 (diff) | |
download | git-eb9cb55b944796374402ab4e2639300dc9b0b409.tar.gz |
Convert ce_path_match() to use 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/update-index.c')
-rw-r--r-- | builtin/update-index.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c index 56baf27fb7..d7850c6309 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -546,7 +546,10 @@ static int do_reupdate(int ac, const char **av, */ int pos; int has_head = 1; - const char **pathspec = get_pathspec(prefix, av + 1); + const char **paths = get_pathspec(prefix, av + 1); + struct pathspec pathspec; + + init_pathspec(&pathspec, paths); if (read_ref("HEAD", head_sha1)) /* If there is no HEAD, that means it is an initial @@ -559,7 +562,7 @@ static int do_reupdate(int ac, const char **av, struct cache_entry *old = NULL; int save_nr; - if (ce_stage(ce) || !ce_path_match(ce, pathspec)) + if (ce_stage(ce) || !ce_path_match(ce, &pathspec)) continue; if (has_head) old = read_one_ent(NULL, head_sha1, @@ -578,6 +581,7 @@ static int do_reupdate(int ac, const char **av, if (save_nr != active_nr) goto redo; } + free_pathspec(&pathspec); return 0; } |