aboutsummaryrefslogtreecommitdiff
path: root/update-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-05 23:09:05 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-05 23:11:29 -0700
commit22293b9c41778bb60f3b07355e1b8e421a503702 (patch)
treebe961d45c75997188212d0f383b0859fef5f2442 /update-index.c
parent83e77a25dc194933c0fb7908ab6d9fb84a5045e2 (diff)
downloadgit-22293b9c41778bb60f3b07355e1b8e421a503702.tar.gz
git-22293b9c41778bb60f3b07355e1b8e421a503702.tar.xz
update-index --again: take optional pathspecs
When pathspecs are given, update-index --again further limits the set of paths to be updated to those that match them. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'update-index.c')
-rw-r--r--update-index.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/update-index.c b/update-index.c
index 5496d68ae..184b2526d 100644
--- a/update-index.c
+++ b/update-index.c
@@ -610,6 +610,7 @@ static int do_reupdate(int ac, const char **av,
*/
int pos;
int has_head = 1;
+ char **pathspec = get_pathspec(prefix, av + 1);
if (read_ref(git_path("HEAD"), head_sha1))
/* If there is no HEAD, that means it is an initial
@@ -621,7 +622,8 @@ static int do_reupdate(int ac, const char **av,
struct cache_entry *ce = active_cache[pos];
struct cache_entry *old = NULL;
int save_nr;
- if (ce_stage(ce))
+
+ if (ce_stage(ce) || !ce_path_match(ce, pathspec))
continue;
if (has_head)
old = read_one_ent(NULL, head_sha1,