only use fallback for default remote

This commit is contained in:
Brian Camacho 2023-08-24 17:11:39 -07:00
parent e09b7b07fe
commit dd3379d2a5

@ -125,7 +125,9 @@ func (e *endpointGitFinder) RemoteEndpoint(operation, remote string) lfshttp.End
}
gitDir, err := git.GitDir()
if err == nil {
// Finally, fall back on .git/FETCH_HEAD but only if it exists and no specific remote was requested
// We can't know which remote FETCH_HEAD is pointing to
if err == nil && remote == defaultRemote {
url, err := parseFetchHead(strings.Join([]string{gitDir, "FETCH_HEAD"}, "/"));
if err == nil {
endpoint := e.NewEndpointFromCloneURL("download", url);