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:
authorJohn Cai <jcai@gitlab.com>2022-07-18 22:57:53 +0300
committerJohn Cai <jcai@gitlab.com>2022-07-18 23:05:49 +0300
commit5a3c95dd3c80dbbe58fb8971aa514c06bfb893d8 (patch)
tree6c959476d937c46de443ffce3744d0a99afb478d
parenta454dd8c911101edb4d1d7b8218301584ea199e7 (diff)
git: Hide refs for upload-packjc-upload-pack-hide-refs
Currently we are relying on an omnibus setting that sets a git config value to hide certain hidden refs during transfer. However, we no longer want to rely on git config files that are external to Gitaly but rather inject config values we need directly into the command. We already do this for receive-pack but not for upload-pack. Add the corresponding config for upload-pack. Changelog: changed
-rw-r--r--internal/git/command_description.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/git/command_description.go b/internal/git/command_description.go
index a56580e0b..9ac0b841e 100644
--- a/internal/git/command_description.go
+++ b/internal/git/command_description.go
@@ -299,12 +299,12 @@ var commandDescriptions = map[string]commandDescription{
},
"upload-pack": {
flags: scNoRefUpdates,
- opts: append([]GlobalOption{
+ opts: append(append([]GlobalOption{
ConfigPair{Key: "uploadpack.allowFilter", Value: "true"},
// Enables the capability to request individual SHA1's from the
// remote repo.
ConfigPair{Key: "uploadpack.allowAnySHA1InWant", Value: "true"},
- }, packConfiguration()...),
+ }, hiddenUploadPackRefPrefixes()...), packConfiguration()...),
},
"version": {
flags: scNoRefUpdates,
@@ -413,6 +413,16 @@ func hiddenReceivePackRefPrefixes() []GlobalOption {
return cps
}
+func hiddenUploadPackRefPrefixes() []GlobalOption {
+ var cps []GlobalOption
+
+ for _, ns := range InternalRefPrefixes {
+ cps = append(cps, ConfigPair{Key: "uploadpack.hideRefs", Value: ns})
+ }
+
+ return cps
+}
+
// fsckConfiguration generates our fsck configuration, including ignored checks. The prefix must
// either be "receive" or "fetch" and indicates whether it should apply to git-receive-pack(1) or to
// git-fetch-pack(1).