From 1d64521df7b21621ea5604818317b5ecb13a6a1d Mon Sep 17 00:00:00 2001 From: Chris Darroch Date: Sun, 4 Jun 2023 22:25:03 -0700 Subject: [PATCH] lfs/gitscanner.go: remove unused scan method In commit d0e950d650d19e04fbe031d01b5fa51b95195116 of PR #3978 the ScanMultiRangeToRemote() method of the GitScanner structure was added, and the sole caller of the existing ScanRangeToRemote() method was revised to call the new scan method instead. As no additional callers of the existing method have been introduced since then, we can simplify our code by removing the unused method now. --- lfs/gitscanner.go | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/lfs/gitscanner.go b/lfs/gitscanner.go index 4555d885..143a37fc 100644 --- a/lfs/gitscanner.go +++ b/lfs/gitscanner.go @@ -62,7 +62,7 @@ func (s *GitScanner) Close() { } // RemoteForPush sets up this *GitScanner to scan for objects to push to the -// given remote. Needed for ScanRangeToRemote(). +// given remote. Needed for ScanMultiRangeToRemote(). func (s *GitScanner) RemoteForPush(r string) error { s.mu.Lock() defer s.mu.Unlock() @@ -76,25 +76,6 @@ func (s *GitScanner) RemoteForPush(r string) error { return nil } -// ScanRangeToRemote scans through all unique objects reachable from the -// "include" ref but not reachable from the "exclude" ref and which the -// given remote does not have. See RemoteForPush(). -func (s *GitScanner) ScanRangeToRemote(include, exclude string, cb GitScannerFoundPointer) error { - callback, err := firstGitScannerCallback(cb, s.FoundPointer) - if err != nil { - return err - } - - s.mu.Lock() - if len(s.remote) == 0 { - s.mu.Unlock() - return errors.New(tr.Tr.Get("unable to scan starting at %q: no remote set", include)) - } - s.mu.Unlock() - - return scanRefsToChanSingleIncludeExclude(s, callback, include, exclude, s.cfg.GitEnv(), s.cfg.OSEnv(), s.opts(ScanRangeToRemoteMode)) -} - // ScanMultiRangeToRemote scans through all unique objects reachable from the // "include" ref but not reachable from any "exclude" refs and which the // given remote does not have. See RemoteForPush().