feature flag additional refs (#3282)
This commit is contained in:
@@ -5,4 +5,5 @@ import "sync/atomic"
|
|||||||
var (
|
var (
|
||||||
ForceSkipBinaries = atomic.Bool{}
|
ForceSkipBinaries = atomic.Bool{}
|
||||||
ForceSkipArchives = atomic.Bool{}
|
ForceSkipArchives = atomic.Bool{}
|
||||||
|
SkipAdditionalRefs = atomic.Bool{}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -420,10 +420,13 @@ func executeClone(ctx context.Context, params cloneParams) (*git.Repository, err
|
|||||||
"clone",
|
"clone",
|
||||||
cloneURL.String(),
|
cloneURL.String(),
|
||||||
params.clonePath,
|
params.clonePath,
|
||||||
"-c",
|
|
||||||
"remote.origin.fetch=+refs/*:refs/remotes/origin/*",
|
|
||||||
"--quiet", // https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-code--quietcode
|
"--quiet", // https://git-scm.com/docs/git-clone#Documentation/git-clone.txt-code--quietcode
|
||||||
}
|
}
|
||||||
|
if !feature.SkipAdditionalRefs.Load() {
|
||||||
|
gitArgs = append(gitArgs,
|
||||||
|
"-c",
|
||||||
|
"remote.origin.fetch=+refs/*:refs/remotes/origin/*")
|
||||||
|
}
|
||||||
gitArgs = append(gitArgs, params.args...)
|
gitArgs = append(gitArgs, params.args...)
|
||||||
cloneCmd := exec.Command("git", gitArgs...)
|
cloneCmd := exec.Command("git", gitArgs...)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user