Skip to content
Snippets Groups Projects
Commit 744ee924 authored by Georges Racinet's avatar Georges Racinet
Browse files

CommitService.FindCommit: fix discrepancy with Gitaly on null Node

parent 3c6b018d
No related branches found
No related tags found
2 merge requests!169Protocol v15.9 and stable branch merge",!163FindCommit comparison tests: ensure only GitLab state files are used
......@@ -112,6 +112,7 @@
base_logger = logging.getLogger(__name__)
NULL_REV = nodemod.nullrev
PSEUDO_REVS = (nodemod.wdirrev, nodemod.nullrev)
PSEUDO_REVLOG_NODES = {
nodemod.nullid,
......@@ -494,6 +495,9 @@
revision)
return FindCommitResponse()
if ctx.rev() == NULL_REV:
return FindCommitResponse()
commit = message.commit(ctx)
return FindCommitResponse(commit=commit)
......
......@@ -269,6 +269,9 @@
assert not find_commit(b'f' * 39).HasField('commit')
assert not find_commit(b'f' * 40).HasField('commit')
# null revision
assert not find_commit(b'0' * 40).HasField('commit')
def test_find_commits(commit_fixture_empty_repo):
fixture = commit_fixture_empty_repo
......
......@@ -225,6 +225,7 @@
mr_ref_path, _ = fixture.write_special_ref(b'merge-requests/2/train',
ctx1.hex())
assert_compare(revision=b"0000" * 10)
assert_compare(revision=ctx0.hex())
assert_compare(revision=b'branch/default')
assert_compare(revision=b'refs/heads/branch/default')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment