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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-02 08:24:47 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-08-03 07:58:02 +0300
commit8bdd79826c9817796b5d77c45cc15d7ce350a20c (patch)
tree0030b7e89247d58dc0d19764a9119fd265f98ecb
parenta4f0038ddfcdcecda9205079d1f5518275b54027 (diff)
catfile: Enable testing with SHA256 object hashespks-git-catfile-sha-256
Now that the catfile package supports SHA256 object hashes we can remove the build tags that keep the tests from running in SHA256-mode.
-rw-r--r--internal/git/catfile/cache_test.go2
-rw-r--r--internal/git/catfile/commit_test.go2
-rw-r--r--internal/git/catfile/object_info_reader_test.go11
-rw-r--r--internal/git/catfile/object_reader_test.go2
-rw-r--r--internal/git/catfile/parser_test.go2
-rw-r--r--internal/git/catfile/request_queue_test.go2
-rw-r--r--internal/git/catfile/tag_test.go2
-rw-r--r--internal/git/catfile/testhelper_test.go2
8 files changed, 7 insertions, 18 deletions
diff --git a/internal/git/catfile/cache_test.go b/internal/git/catfile/cache_test.go
index ec3dc9e9a..0ac225444 100644
--- a/internal/git/catfile/cache_test.go
+++ b/internal/git/catfile/cache_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/commit_test.go b/internal/git/catfile/commit_test.go
index 246bd0bbb..81fceccec 100644
--- a/internal/git/catfile/commit_test.go
+++ b/internal/git/catfile/commit_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/object_info_reader_test.go b/internal/git/catfile/object_info_reader_test.go
index 92d1ff52c..7d9614602 100644
--- a/internal/git/catfile/object_info_reader_test.go
+++ b/internal/git/catfile/object_info_reader_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
@@ -129,7 +127,7 @@ func TestObjectInfoReader(t *testing.T) {
"refs/tags/v1.1.1",
} {
revParseOutput := gittest.Exec(t, cfg, "-C", repoPath, "rev-parse", revision)
- objectID, err := git.ObjectHashSHA1.FromHex(text.ChompBytes(revParseOutput))
+ objectID, err := gittest.DefaultObjectHash.FromHex(text.ChompBytes(revParseOutput))
require.NoError(t, err)
objectType := text.ChompBytes(gittest.Exec(t, cfg, "-C", repoPath, "cat-file", "-t", revision))
@@ -225,7 +223,12 @@ func TestObjectInfoReader_queue(t *testing.T) {
commitInfo := ObjectInfo{
Oid: commitOID,
Type: "commit",
- Size: 177,
+ Size: func() int64 {
+ if gittest.ObjectHashIsSHA256() {
+ return 201
+ }
+ return 177
+ }(),
}
t.Run("read single info", func(t *testing.T) {
diff --git a/internal/git/catfile/object_reader_test.go b/internal/git/catfile/object_reader_test.go
index 0823b7e43..9aade3b47 100644
--- a/internal/git/catfile/object_reader_test.go
+++ b/internal/git/catfile/object_reader_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/parser_test.go b/internal/git/catfile/parser_test.go
index d2756b0ea..59afbb127 100644
--- a/internal/git/catfile/parser_test.go
+++ b/internal/git/catfile/parser_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/request_queue_test.go b/internal/git/catfile/request_queue_test.go
index c5c51ce63..9dede16aa 100644
--- a/internal/git/catfile/request_queue_test.go
+++ b/internal/git/catfile/request_queue_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/tag_test.go b/internal/git/catfile/tag_test.go
index 5274d2f56..efc54e20c 100644
--- a/internal/git/catfile/tag_test.go
+++ b/internal/git/catfile/tag_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (
diff --git a/internal/git/catfile/testhelper_test.go b/internal/git/catfile/testhelper_test.go
index 90d6e8b1f..dc8b7994f 100644
--- a/internal/git/catfile/testhelper_test.go
+++ b/internal/git/catfile/testhelper_test.go
@@ -1,5 +1,3 @@
-//go:build !gitaly_test_sha256
-
package catfile
import (