trim whitespace from GIT_ASKPASS provided passwords
This commit is contained in:
parent
7182aba593
commit
f9f11aac8a
@ -197,7 +197,7 @@ func (a *AskPassCredentialHelper) Fill(what Creds) (Creds, error) {
|
|||||||
// store it in the creds instance that we will return to the caller.
|
// store it in the creds instance that we will return to the caller.
|
||||||
creds := make(Creds)
|
creds := make(Creds)
|
||||||
creds["username"] = strings.TrimSpace(user.String())
|
creds["username"] = strings.TrimSpace(user.String())
|
||||||
creds["password"] = pass.String()
|
creds["password"] = strings.TrimSpace(pass.String())
|
||||||
|
|
||||||
return creds, nil
|
return creds, nil
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Print(answer)
|
fmt.Println(answer)
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ begin_test "askpass: push with GIT_ASKPASS"
|
|||||||
|
|
||||||
grep "filling with GIT_ASKPASS: lfs-askpass Username for \"$GITSERVER/$reponame\"" push.log
|
grep "filling with GIT_ASKPASS: lfs-askpass Username for \"$GITSERVER/$reponame\"" push.log
|
||||||
grep "filling with GIT_ASKPASS: lfs-askpass Password for \"$GITSERVER_USER/$reponame\"" push.log
|
grep "filling with GIT_ASKPASS: lfs-askpass Password for \"$GITSERVER_USER/$reponame\"" push.log
|
||||||
|
grep "master -> master" push.log
|
||||||
)
|
)
|
||||||
end_test
|
end_test
|
||||||
|
|
||||||
@ -60,5 +61,6 @@ begin_test "askpass: push with core.askPass"
|
|||||||
|
|
||||||
grep "filling with GIT_ASKPASS: lfs-askpass Username for \"$GITSERVER/$reponame\"" push.log
|
grep "filling with GIT_ASKPASS: lfs-askpass Username for \"$GITSERVER/$reponame\"" push.log
|
||||||
grep "filling with GIT_ASKPASS: lfs-askpass Password for \"$GITSERVER_USER/$reponame\"" push.log
|
grep "filling with GIT_ASKPASS: lfs-askpass Password for \"$GITSERVER_USER/$reponame\"" push.log
|
||||||
|
grep "master -> master" push.log
|
||||||
)
|
)
|
||||||
end_test
|
end_test
|
||||||
|
Loading…
Reference in New Issue
Block a user