diff -r e5cd8d1a094d -r be1cc65bdb1c hgext/lfs/blobstore.py --- a/hgext/lfs/blobstore.py Wed Apr 11 17:29:55 2018 -0400 +++ b/hgext/lfs/blobstore.py Sun Apr 08 01:23:39 2018 -0400 @@ -541,9 +541,15 @@ """ url = util.url(repo.ui.config('lfs', 'url') or '') if url.scheme is None: - # TODO: investigate 'paths.remote:lfsurl' style path customization, - # and fall back to inferring from 'paths.remote' if unspecified. - defaulturl = util.url(repo.ui.config('paths', 'default') or b'') + if util.safehasattr(repo, '_subtoppath'): + # The pull command sets this during the optional update phase, which + # tells exactly where the pull originated, whether 'paths.default' + # or explicit. + defaulturl = util.url(repo._subtoppath) + else: + # TODO: investigate 'paths.remote:lfsurl' style path customization, + # and fall back to inferring from 'paths.remote' if unspecified. + defaulturl = util.url(repo.ui.config('paths', 'default') or b'') # TODO: support local paths as well. # TODO: consider the ssh -> https transformation that git applies