diff options
Diffstat (limited to 'src/repository.c')
-rw-r--r-- | src/repository.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/repository.c b/src/repository.c index 6c7370324..89d8ab132 100644 --- a/src/repository.c +++ b/src/repository.c @@ -2299,45 +2299,6 @@ out: return error; } -int git_repository_foreach_head(git_repository *repo, - git_repository_foreach_head_cb cb, - int flags, void *payload) -{ - git_strarray worktrees = GIT_VECTOR_INIT; - git_buf path = GIT_BUF_INIT; - int error = 0; - size_t i; - - - if (!(flags & GIT_REPOSITORY_FOREACH_HEAD_SKIP_REPO)) { - /* Gather HEAD of main repository */ - if ((error = git_buf_joinpath(&path, repo->commondir, GIT_HEAD_FILE)) < 0 || - (error = cb(repo, path.ptr, payload) != 0)) - goto out; - } - - if (!(flags & GIT_REPOSITORY_FOREACH_HEAD_SKIP_WORKTREES)) { - if ((error = git_worktree_list(&worktrees, repo)) < 0) { - error = 0; - goto out; - } - - /* Gather HEADs of all worktrees */ - for (i = 0; i < worktrees.count; i++) { - if (get_worktree_file_path(&path, repo, worktrees.strings[i], GIT_HEAD_FILE) < 0) - continue; - - if ((error = cb(repo, path.ptr, payload)) != 0) - goto out; - } - } - -out: - git_buf_dispose(&path); - git_strarray_dispose(&worktrees); - return error; -} - int git_repository_head_unborn(git_repository *repo) { git_reference *ref = NULL; |