summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-05 12:53:29 -0700
committerJunio C Hamano <gitster@pobox.com>2017-05-06 19:15:39 +0900
commite799ed408eb59ca631c4908ba4236cd146ff6bd2 (patch)
tree59d3f02972ecab935e33c2fa4a147432b21cf1a2 /dir.c
parent473e39307d8c9db93bd08d82898e7fff7002c8cb (diff)
downloadgit-e799ed408eb59ca631c4908ba4236cd146ff6bd2.tar.gz
dir: convert prep_exclude to take an index
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/dir.c b/dir.c
index b86d02ff94..50b5e720e9 100644
--- a/dir.c
+++ b/dir.c
@@ -1046,7 +1046,9 @@ static struct exclude *last_exclude_matching_from_lists(struct dir_struct *dir,
* Loads the per-directory exclude list for the substring of base
* which has a char length of baselen.
*/
-static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
+static void prep_exclude(struct dir_struct *dir,
+ struct index_state *istate,
+ const char *base, int baselen)
{
struct exclude_list_group *group;
struct exclude_list *el;
@@ -1125,7 +1127,7 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
int dt = DT_DIR;
dir->basebuf.buf[stk->baselen - 1] = 0;
dir->exclude = last_exclude_matching_from_lists(dir,
- &the_index,
+ istate,
dir->basebuf.buf, stk->baselen - 1,
dir->basebuf.buf + current, &dt);
dir->basebuf.buf[stk->baselen - 1] = '/';
@@ -1167,7 +1169,7 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
strbuf_addbuf(&sb, &dir->basebuf);
strbuf_addstr(&sb, dir->exclude_per_dir);
el->src = strbuf_detach(&sb, NULL);
- add_excludes(el->src, el->src, stk->baselen, el, &the_index,
+ add_excludes(el->src, el->src, stk->baselen, el, istate,
untracked ? &sha1_stat : NULL);
}
/*
@@ -1209,7 +1211,7 @@ struct exclude *last_exclude_matching(struct dir_struct *dir,
const char *basename = strrchr(pathname, '/');
basename = (basename) ? basename+1 : pathname;
- prep_exclude(dir, pathname, basename-pathname);
+ prep_exclude(dir, &the_index, pathname, basename-pathname);
if (dir->exclude)
return dir->exclude;
@@ -1695,10 +1697,10 @@ static int valid_cached_dir(struct dir_struct *dir,
*/
if (path->len && path->buf[path->len - 1] != '/') {
strbuf_addch(path, '/');
- prep_exclude(dir, path->buf, path->len);
+ prep_exclude(dir, &the_index, path->buf, path->len);
strbuf_setlen(path, path->len - 1);
} else
- prep_exclude(dir, path->buf, path->len);
+ prep_exclude(dir, &the_index, path->buf, path->len);
/* hopefully prep_exclude() haven't invalidated this entry... */
return untracked->valid;