diff options
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/iterator.c b/src/iterator.c index 76b0e41d0..5917f63fd 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -1321,9 +1321,10 @@ static void workdir_iterator__free(git_iterator *self) git_ignore__free(&wi->ignores); } -int git_iterator_for_workdir( +int git_iterator_for_workdir_ext( git_iterator **out, git_repository *repo, + const char *repo_workdir, git_iterator_flag_t flags, const char *start, const char *end) @@ -1331,8 +1332,11 @@ int git_iterator_for_workdir( int error; workdir_iterator *wi; - if (git_repository__ensure_not_bare(repo, "scan working directory") < 0) - return GIT_EBAREREPO; + if (!repo_workdir) { + if (git_repository__ensure_not_bare(repo, "scan working directory") < 0) + return GIT_EBAREREPO; + repo_workdir = git_repository_workdir(repo); + } /* initialize as an fs iterator then do overrides */ wi = git__calloc(1, sizeof(workdir_iterator)); @@ -1352,7 +1356,7 @@ int git_iterator_for_workdir( return error; } - return fs_iterator__initialize(out, &wi->fi, git_repository_workdir(repo)); + return fs_iterator__initialize(out, &wi->fi, repo_workdir); } |