From 2ecc5533e1af87579cc71422279dcf206376bfa4 Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Tue, 17 Oct 2023 10:21:35 -0700 Subject: [PATCH] tq/manifest.go: lookup standalone endpoint once The findStandaloneTransfer() function of the "tq" package was updated in commit 28f9b73d2f2bc529ce4385d372ab900e3763b854 of PR #3905 to determine whether to use the built-in file standalone transfer adapter based on the actual endpoint URL, taking into account settings like "lfs.url" which override the endpoint URL we would otherwise construct from the current remote's URL. However, the code still checked the "lfs..standaloneTransferAgent" setting using the URL constructed from the remote's URL, and so called both the Endpoint() and RemoteEndpoint() methods of the EndpointFinder interface. Then in commit 594f8e386cce3441e06c9094ab5e251f0e07ca1f of PR #4446, when the pure SSH transfer protocol was introduced, the call to the RemoteEndpoint() method was replaced with Endpoint(), which was done with the intent that it would honour "lfs.url" settings as well. However, this resulted in duplicate calls to Endpoint(), so we can remove one of them now. Note that the change in commit 594f8e386cce3441e06c9094ab5e251f0e07ca1f of PR #4446 implies that the URL used when looking for "lfs..standaloneTransferAgent" settings is the URL as fully determined by settings such as "lfs.url" that override what would be otherwise constructed based on the remote's URL. We expect to add documentation to this effect in a subsequent PR. --- tq/manifest.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tq/manifest.go b/tq/manifest.go index 8928f674..03d2eab0 100644 --- a/tq/manifest.go +++ b/tq/manifest.go @@ -274,11 +274,10 @@ func findStandaloneTransfer(client *lfsapi.Client, operation, remote string) str } ep := client.Endpoints.Endpoint(operation, remote) - aep := client.Endpoints.Endpoint(operation, remote) uc := config.NewURLConfig(client.GitEnv()) v, ok := uc.Get("lfs", ep.Url, "standalonetransferagent") if !ok { - return findDefaultStandaloneTransfer(aep.Url) + return findDefaultStandaloneTransfer(ep.Url) } return v