diff options
author | Will Chandler <wchandler@gitlab.com> | 2023-02-02 00:19:08 +0300 |
---|---|---|
committer | Will Chandler <wchandler@gitlab.com> | 2023-02-02 17:50:37 +0300 |
commit | 0b1b76c73f6bc3fb6ac9ace06fd478be5a4e0255 (patch) | |
tree | 5e7b81e671b0a1eb561058d4a0f7c492356a073a /internal/gitaly/service/operations/submodules_test.go | |
parent | 6f5c8288c7447e0dc382024467b8f1e5a7239fb5 (diff) |
git: Include reason oid is invalid in error
Previously `ValidateHex` returned a generic error message when an
invalid string representation of a SHA1 or SHA256 oid was found. This
gave no indication as to why the oid was rejected.
Now that we are iterating over characters manually rather than using a
regexp, we are in a position to provide users with more detail on what
is invalid about the object ID. Introduce new error types to bubble this
information up to users.
Diffstat (limited to 'internal/gitaly/service/operations/submodules_test.go')
-rw-r--r-- | internal/gitaly/service/operations/submodules_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/gitaly/service/operations/submodules_test.go b/internal/gitaly/service/operations/submodules_test.go index a51dc8ca3..02f35d8c9 100644 --- a/internal/gitaly/service/operations/submodules_test.go +++ b/internal/gitaly/service/operations/submodules_test.go @@ -565,7 +565,7 @@ func TestUserUpdateSubmodule(t *testing.T) { ExpectedOldOid: "foobar", }, commitID: commitID.String(), - expectedErr: structerr.NewInvalidArgument(`invalid expected old object ID: invalid object ID: "foobar"`). + expectedErr: structerr.NewInvalidArgument(fmt.Sprintf(`invalid expected old object ID: invalid object ID: "foobar", expected length %v, got 6`, gittest.DefaultObjectHash.EncodedLen())). WithInterceptedMetadata("old_object_id", "foobar"), verify: func(t *testing.T) {}, } |