MCPcopy
hub / github.com/git-lfs/git-lfs / PushRemote

Method PushRemote

config/config.go:265–287  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

263}
264
265func (c *Configuration) PushRemote() string {
266 ref := c.CurrentRef()
267 c.loading.Lock()
268 defer c.loading.Unlock()
269
270 if c.pushRemote == nil {
271 if remote, ok := c.Git.Get(fmt.Sprintf("branch.%s.pushRemote", ref.Name)); ok {
272 c.pushRemote = &remote
273 } else if remote, ok := c.Git.Get("remote.lfspushdefault"); ok {
274 c.pushRemote = &remote
275 } else if remote, ok := c.Git.Get("remote.pushDefault"); ok {
276 c.pushRemote = &remote
277 } else {
278 c.loading.Unlock()
279 remote := c.Remote()
280 c.loading.Lock()
281
282 c.pushRemote = &remote
283 }
284 }
285
286 return *c.pushRemote
287}
288
289func (c *Configuration) SetValidRemote(name string) error {
290 if err := git.ValidateRemote(name); err != nil {

Callers 15

RemoteRefMethod · 0.80
EnvironFunction · 0.80
locksCommandFunction · 0.80
lockCommandFunction · 0.80
newLockClientFunction · 0.80
currentRemoteRefFunction · 0.80
newUploadContextFunction · 0.80
prePushRefsFunction · 0.80
lfsPushRefsFunction · 0.80
VerifyMethod · 0.80
newLockVerifierFunction · 0.80
unlockCommandFunction · 0.80

Calls 5

CurrentRefMethod · 0.95
RemoteMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65
GetMethod · 0.65

Tested by 7

TestRemoteDefaultFunction · 0.64
TestRemoteBranchConfigFunction · 0.64
TestRemotePushDefaultFunction · 0.64
TestLFSDefaultFunction · 0.64
TestLFSDefaultSimpleFunction · 0.64
TestLFSDefaultBranchFunction · 0.64