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

Function setRequestAuthFromURL

lfsapi/auth.go:295–307  ·  view source on GitHub ↗
(req *http.Request, u *url.URL)

Source from the content-addressed store, hash-verified

293}
294
295func setRequestAuthFromURL(req *http.Request, u *url.URL) bool {
296 if u.User == nil {
297 return false
298 }
299
300 if pass, ok := u.User.Password(); ok {
301 fmt.Fprintln(os.Stderr, tr.Tr.Get("warning: current Git remote contains credentials"))
302 setRequestAuth(req, u.User.Username(), pass)
303 return true
304 }
305
306 return false
307}
308
309func setRequestAuth(req *http.Request, user, pass string) {
310 if len(user) == 0 && len(pass) == 0 {

Callers 1

getCredURLForAPIFunction · 0.85

Calls 2

setRequestAuthFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected