Re: [PATCH] builtin-commit: fix partial-commit support
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:52
Junio C Hamano [off-list ref] writes:
quoted hunk
diff --git a/builtin-commit.c b/builtin-commit.c index 3e7d281..e487bc0 100644 --- a/builtin-commit.c +++ b/builtin-commit.c
There was another...
+static int list_paths(struct path_list *list, const char *with_tree,
+ const char *prefix, const char **pattern)
+{
+ struct dir_struct dir;
+ int i;
+ char *m;
+
+ for (i = 0; pattern[i]; i++)
+ ;
+ m = xcalloc(1, i);
+
+ memset(&dir, 0, sizeof(dir));
+ if (with_tree)
+ overlay_tree_on_cache(with_tree, prefix);
+
+ for (i = 0; i < active_nr; i++) {
+ struct cache_entry *ce = active_cache[i];
+ if (ce->ce_flags & htons(CE_UPDATE))
+ continue;
+ if (!pathspec_match(pattern, m, ce->name, 0))
+ continue;
+ if (excluded(&dir, ce->name))
+ continue;
+ path_list_insert(ce->name, list);
+ }This "excluded", and the whole "struct dir" business is unneeded, as we are walking on the index and finding the set of paths the user cares about.