diff options
author | Terry Parker <tparker@google.com> | 2018-06-26 16:44:01 -0700 |
---|---|---|
committer | Terry Parker <tparker@google.com> | 2018-06-26 20:13:47 -0700 |
commit | 115a740e2fa65d3ab70f150691b045ecfdb146bb (patch) | |
tree | a305a363901e9d79437353fa74a120aa4aa32577 /org.eclipse.jgit.http.apache | |
parent | e8e4fe7af674baf13acd074f7207d7e6758d0ec6 (diff) | |
download | jgit-115a740e2fa65d3ab70f150691b045ecfdb146bb.tar.gz jgit-115a740e2fa65d3ab70f150691b045ecfdb146bb.zip |
Correctly handle initialization of shallow commits
In a new RevWalk, if the first object parsed is one of the
shallow commits, the following happens:
1) RevCommit.parseCanonical() is called on a new "r1" RevCommit.
2) RevCommit.parseCanonical() immediately calls
RevWalk.initializeShallowCommits().
3) RevWalk.initializeShallowCommits() calls lookupCommit(id),
creating and adding a new "r2" version of this same object and
marking its parents empty.
4) RevCommit.parseCanonical() initializes the "r1" RevCommit's
fields, including the parents.
5) RevCommit.parseCanonical()'s caller uses the "r1" commit that
has parents, losing the fact that it is a shallow commit.
This change passes the current RevCommit as an argument to
RevWalk.initializeShallowCommits() so that method can set its
parents empty rather than creating the duplicate "r2" commit.
Change-Id: I67b79aa2927dd71ac7b0d8f8917f423dcaf08c8a
Signed-off-by: Terry Parker <tparker@google.com>
Diffstat (limited to 'org.eclipse.jgit.http.apache')
0 files changed, 0 insertions, 0 deletions