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>2023-01-17 14:59:13 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-01-20 12:43:59 +0300
commit5bbe9453868a501e23efdb9236f021b2a2fb3a15 (patch)
treefe78e476b445a5cb32b7486d105f947cc76feaff
parenta79935b8d612569247deb585fca006efca91c4b3 (diff)
housekeeping: Simplify the code that controls writing of bitmaps
Simplify the code that controls writing of bitmaps so that we don't need to branch manually anymore.
-rw-r--r--internal/git/housekeeping/objects.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/internal/git/housekeeping/objects.go b/internal/git/housekeeping/objects.go
index b823f762a..7150f85d2 100644
--- a/internal/git/housekeeping/objects.go
+++ b/internal/git/housekeeping/objects.go
@@ -2,6 +2,7 @@ package housekeeping
import (
"context"
+ "strconv"
"gitlab.com/gitlab-org/gitaly/v15/internal/git"
"gitlab.com/gitlab-org/gitaly/v15/internal/git/localrepo"
@@ -65,6 +66,7 @@ func RepackObjects(ctx context.Context, repo *localrepo.Repo, cfg RepackObjectsC
func GetRepackGitConfig(ctx context.Context, repo repository.GitRepo, bitmap bool) []git.ConfigPair {
config := []git.ConfigPair{
{Key: "repack.useDeltaIslands", Value: "true"},
+ {Key: "repack.writeBitmaps", Value: strconv.FormatBool(bitmap)},
}
if IsPoolRepository(repo) {
@@ -81,11 +83,5 @@ func GetRepackGitConfig(ctx context.Context, repo repository.GitRepo, bitmap boo
)
}
- if bitmap {
- config = append(config, git.ConfigPair{Key: "repack.writeBitmaps", Value: "true"})
- } else {
- config = append(config, git.ConfigPair{Key: "repack.writeBitmaps", Value: "false"})
- }
-
return config
}