diff --git a/commands/command_fetch.go b/commands/command_fetch.go index 94d19583..e131c9b5 100644 --- a/commands/command_fetch.go +++ b/commands/command_fetch.go @@ -43,8 +43,6 @@ func fetchCommand(cmd *cobra.Command, args []string) { Exit("Invalid remote name %q", args[0]) } cfg.SetRemote(args[0]) - } else { - cfg.SetRemote("") } if len(args) > 1 { @@ -268,16 +266,6 @@ func scanAll() []*lfs.WrappedPointer { // Fetch and report completion of each OID to a channel (optional, pass nil to skip) // Returns true if all completed with no errors, false if errors were written to stderr/log func fetchAndReportToChan(allpointers []*lfs.WrappedPointer, filter *filepathfilter.Filter, out chan<- *lfs.WrappedPointer) bool { - // Lazily initialize the current remote. - if len(cfg.Remote()) == 0 { - // Actively find the default remote, don't just assume origin - defaultRemote, err := cfg.GitConfig().DefaultRemote() - if err != nil { - Exit("No default remote") - } - cfg.SetRemote(defaultRemote) - } - ready, pointers, meter := readyAndMissingPointers(allpointers, filter) q := newDownloadQueue( getTransferManifestOperationRemote("download", cfg.Remote()), diff --git a/test/test-fetch.sh b/test/test-fetch.sh index f17f15b3..a8fa2a04 100755 --- a/test/test-fetch.sh +++ b/test/test-fetch.sh @@ -440,12 +440,6 @@ begin_test "fetch with no origin remote" # and no origin, but only 1 remote, should pick the only one as default git lfs fetch assert_local_object "$contents_oid" 1 - - # delete again, now add a second remote, also non-origin - rm -rf .git/lfs - git remote add something2 "$GITSERVER/$reponame" - git lfs fetch 2>&1 | grep "No default remote" - refute_local_object "$contents_oid" ) end_test