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

DiffService for GitLab 16.2: fixed status code for unresolved revisions

The change appeared between Gitaly 16.0 and 16.2.
parent b8ef0422
No related branches found
No related tags found
2 merge requests!204Making Heptapod 0.40 the new oldstable,!199Minor adaptations for GitLab 16.2
......@@ -269,7 +269,7 @@
parsed_request = parse_diff_request(self, request, context)
parsed, repo, ctx_from, ctx_to = parsed_request
if not parsed:
context.abort(StatusCode.UNAVAILABLE, "exit status 128")
context.abort(StatusCode.FAILED_PRECONDITION, "exit status 128")
m = None
if request.paths:
......@@ -340,7 +340,7 @@
parsed_request = parse_diff_request(self, request, context)
_parsed, repo, ctx_from, ctx_to = parsed_request
if not _parsed:
context.abort(StatusCode.UNAVAILABLE, "exit status 128")
context.abort(StatusCode.FAILED_PRECONDITION, "exit status 128")
m = None
if request.paths:
m = scmutil.matchfiles(repo, request.paths)
......@@ -440,7 +440,7 @@
parsed_request = parse_diff_request(self, request, context)
_parsed, repo, ctx_from, ctx_to = parsed_request
if not _parsed:
context.abort(StatusCode.UNAVAILABLE, "exit status 128")
context.abort(StatusCode.FAILED_PRECONDITION, "exit status 128")
diffchunks = ctx_to.diff(ctx_from, opts=diff_opts(repo))
......
......@@ -429,7 +429,7 @@
sha_not_exists = b'deadnode' * 5
with pytest.raises(grpc.RpcError) as exc_info:
commit_diff(sha_not_exists, ctx3.hex())
assert exc_info.value.code() == grpc.StatusCode.UNAVAILABLE
assert exc_info.value.code() == grpc.StatusCode.FAILED_PRECONDITION
def test_commit_delta(diff_fixture):
......@@ -504,7 +504,7 @@
sha_not_exists = b'deadnode' * 5
with pytest.raises(grpc.RpcError) as exc_info:
commit_delta(sha_not_exists, ctx3.hex())
assert exc_info.value.code() == grpc.StatusCode.UNAVAILABLE
assert exc_info.value.code() == grpc.StatusCode.FAILED_PRECONDITION
def test_diff_stats(diff_fixture):
......@@ -553,7 +553,7 @@
sha_not_exists = b'deadnode' * 5
with pytest.raises(grpc.RpcError) as exc_info:
diff_stats(sha_not_exists, ctx3.hex())
assert exc_info.value.code() == grpc.StatusCode.UNAVAILABLE
assert exc_info.value.code() == grpc.StatusCode.FAILED_PRECONDITION
def test_find_changed_paths(diff_fixture):
......
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