Skip to content

Commit

Permalink
feature flag additional refs (#3282)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-decker authored Sep 10, 2024
1 parent b7411d2 commit 70c6bb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package feature
import "sync/atomic"

var (
ForceSkipBinaries = atomic.Bool{}
ForceSkipArchives = atomic.Bool{}
ForceSkipBinaries = atomic.Bool{}
ForceSkipArchives = atomic.Bool{}
SkipAdditionalRefs = atomic.Bool{}
)
7 changes: 5 additions & 2 deletions pkg/sources/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,13 @@ func executeClone(ctx context.Context, params cloneParams) (*git.Repository, err
"clone",
cloneURL.String(),
params.clonePath,
"-c",
"remote.origin.fetch=+refs/*:refs/remotes/origin/*",
"--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...)
cloneCmd := exec.Command("git", gitArgs...)

Expand Down

0 comments on commit 70c6bb5

Please sign in to comment.