Files
ad1ddc133a (fix) Git Repo Cloning Error (#4223)
* instead of providing list of refs we want to scan, using --mirror parameter .
removed SkipAdditionalRefs flag, cloning using --mirror will include all the refs.
put the check if userinfo is nil to avoid any crash due to invalid memory access.

* keep both -c and --mirror

* keep useGitMirror on by default for OSS

---------

Co-authored-by: Shahzad Haider <[email protected]>
Co-authored-by: Dustin Decker <[email protected]>
Co-authored-by: ahrav <[email protected]>
2025-07-25 10:30:30 -07:00

38 lines
889 B
Go

package feature
import "sync/atomic"
var (
ForceSkipBinaries atomic.Bool
ForceSkipArchives atomic.Bool
SkipAdditionalRefs atomic.Bool
EnableAPKHandler atomic.Bool
UserAgentSuffix AtomicString
UseSimplifiedGitlabEnumeration atomic.Bool
UseGitMirror atomic.Bool
)
type AtomicString struct {
value atomic.Value
}
// Load returns the current value of the atomic string
func (as *AtomicString) Load() string {
if v := as.value.Load(); v != nil {
return v.(string)
}
return ""
}
// Store sets the value of the atomic string
func (as *AtomicString) Store(newValue string) {
as.value.Store(newValue)
}
// Swap atomically swaps the current string with a new one and returns the old value
func (as *AtomicString) Swap(newValue string) string {
oldValue := as.Load()
as.Store(newValue)
return oldValue
}