Skip to content

Commit 129cadf

Browse files
author
Edward Thomson
committed
index: support git_index_add_all directories with force
When the contents of an entire new directory is ignored, and `FORCE` is specified to `git_index_add_all`, ensure that we expand the entire file list. By default, diff will coalesce a fully ignored folder into a single diff entry; expand it.
1 parent 309befe commit 129cadf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/libgit2/index.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3509,7 +3509,8 @@ static int index_apply_to_wd_diff(git_index *index, int action, const git_strarr
35093509
GIT_DIFF_RECURSE_UNTRACKED_DIRS;
35103510

35113511
if (flags == GIT_INDEX_ADD_FORCE)
3512-
opts.flags |= GIT_DIFF_INCLUDE_IGNORED;
3512+
opts.flags |= GIT_DIFF_INCLUDE_IGNORED |
3513+
GIT_DIFF_RECURSE_IGNORED_DIRS;
35133514
}
35143515

35153516
if ((error = git_diff_index_to_workdir(&diff, repo, index, &opts)) < 0)

0 commit comments

Comments
 (0)