Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Fargher <jfargher@gitlab.com>2022-10-19 02:11:21 +0300
committerJames Fargher <jfargher@gitlab.com>2022-10-21 02:04:47 +0300
commit59908b8484127f1fa6f8f96be5f86b13e1386029 (patch)
tree167dd8b45268bd71259623b04da3170ac30058c5
parent8de8e0c5ea68e1ed182353fb279a7f190acc3074 (diff)
operations: Add UserCreateBranch test case for conflicting branch name
This test simply verifies the unwanted behaviour of this RPC. Specifically that it returns an internal error instead of a failed precondition.
-rw-r--r--internal/gitaly/service/operations/branches_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/gitaly/service/operations/branches_test.go b/internal/gitaly/service/operations/branches_test.go
index baa8920b9..447cfd1fa 100644
--- a/internal/gitaly/service/operations/branches_test.go
+++ b/internal/gitaly/service/operations/branches_test.go
@@ -368,7 +368,6 @@ func TestUserCreateBranch_Failure(t *testing.T) {
user: gittest.TestUser,
err: status.Errorf(codes.FailedPrecondition, "revspec '%s' not found", "i-dont-exist"),
},
-
{
desc: "branch exists",
branchName: "master",
@@ -376,6 +375,13 @@ func TestUserCreateBranch_Failure(t *testing.T) {
user: gittest.TestUser,
err: status.Errorf(codes.FailedPrecondition, "Could not update %s. Please refresh and try again.", "master"),
},
+ {
+ desc: "conflicting with refs/heads/improve/awesome",
+ branchName: "improve",
+ startPoint: "master",
+ user: gittest.TestUser,
+ err: status.Errorf(codes.Internal, "reference is ambiguous: conflicts with %q", "refs/heads/improve/awesome"),
+ },
}
for _, testCase := range testCases {