8000 Allow revwalk to traverse shallow clones by albfan · Pull Request #5268 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Allow revwalk to traverse shallow clones #5268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow revwalk to traverse shallow clones
  • Loading branch information
albfan committed Oct 15, 2019
commit 064f59e2ff3a53d3b95082f395d88b1cc62f1fbe
11 changes: 9 additions & 2 deletions src/revwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,11 @@ static int still_interesting(git_commit_list *list, int64_t time, int slop)
return slop - 1;
}

static int expected_fail(git_commit *commit) {
//TODO: Check commit is in $GIT_DIR/.git/shallow
return 1;
}

static int limit_list(git_commit_list **out, git_revwalk *walk, git_commit_list *commits)
{
int error, slop = SLOP;
Expand All @@ -452,8 +457,10 @@ static int limit_list(git_commit_list **out, git_revwalk *walk, git_commit_list
while (list) {
git_commit_list_node *commit = git_commit_list_pop(&list);

if ((error = add_parents_to_list(walk, commit, &list)) < 0)
return error;
if ((error = add_parents_to_list(walk, commit, &list)) < 0) {
if (!expected_fail(commit))
return error;
}

if (commit->uninteresting) {
mark_parents_uninteresting(commit);
Expand Down
0