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:
authorDavid Kim <dkim@gitlab.com>2023-10-25 05:38:12 +0300
committerDavid Kim <dkim@gitlab.com>2023-10-25 05:38:12 +0300
commit1edcc70252ea1536aea25dab2f7c5f15703b4610 (patch)
tree05a550199738746788f702fbc0e08fec13cce246
parent26f881b74697af7e2f4c7b02b83e1df07881b81c (diff)
Return an empty string when the patch-id is empty5638-return-nil-patch_id-response-when-diff-is-missing-or-empty
-rw-r--r--internal/gitaly/service/diff/patch_id.go2
-rw-r--r--internal/gitaly/service/diff/patch_id_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/gitaly/service/diff/patch_id.go b/internal/gitaly/service/diff/patch_id.go
index f1f1da95f..09be2827c 100644
--- a/internal/gitaly/service/diff/patch_id.go
+++ b/internal/gitaly/service/diff/patch_id.go
@@ -67,7 +67,7 @@ func (s *server) GetPatchID(ctx context.Context, in *gitalypb.GetPatchIDRequest)
}
if patchIDStdout.Len() == 0 {
- return nil, structerr.NewFailedPrecondition("no difference between old and new revision")
+ return &gitalypb.GetPatchIDResponse{PatchId: ""}, nil
}
// When computing patch IDs for commits directly via e.g. `git show | git patch-id` then the second
diff --git a/internal/gitaly/service/diff/patch_id_test.go b/internal/gitaly/service/diff/patch_id_test.go
index c3a00b82f..255552808 100644
--- a/internal/gitaly/service/diff/patch_id_test.go
+++ b/internal/gitaly/service/diff/patch_id_test.go
@@ -262,7 +262,7 @@ func TestGetPatchID(t *testing.T) {
OldRevision: []byte(commit),
NewRevision: []byte(commit),
},
- expectedErr: structerr.NewFailedPrecondition("no difference between old and new revision"),
+ expectedResponse: &gitalypb.GetPatchIDResponse{PatchId: ""},
}
},
},