##// END OF EJS Templates
lfs: handle paths that don't end with '/' when inferring the blob store...
Matt Harbison -
r37583:9c7a25ef default
parent child Browse files
Show More
@@ -539,23 +539,28 b' def remote(repo, remote=None):'
539 539
540 540 https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md
541 541 """
542 url = util.url(repo.ui.config('lfs', 'url') or '')
543 if url.scheme is None:
542 lfsurl = repo.ui.config('lfs', 'url')
543 url = util.url(lfsurl or '')
544 if lfsurl is None:
544 545 if remote:
545 defaulturl = util.url(remote)
546 path = remote
546 547 elif util.safehasattr(repo, '_subtoppath'):
547 548 # The pull command sets this during the optional update phase, which
548 549 # tells exactly where the pull originated, whether 'paths.default'
549 550 # or explicit.
550 defaulturl = util.url(repo._subtoppath)
551 path = repo._subtoppath
551 552 else:
552 553 # TODO: investigate 'paths.remote:lfsurl' style path customization,
553 554 # and fall back to inferring from 'paths.remote' if unspecified.
554 defaulturl = util.url(repo.ui.config('paths', 'default') or b'')
555 path = repo.ui.config('paths', 'default') or ''
556
557 defaulturl = util.url(path)
555 558
556 559 # TODO: support local paths as well.
557 560 # TODO: consider the ssh -> https transformation that git applies
558 561 if defaulturl.scheme in (b'http', b'https'):
562 if defaulturl.path and defaulturl.path[:-1] != b'/':
563 defaulturl.path += b'/'
559 564 defaulturl.path = defaulturl.path or b'' + b'.git/info/lfs'
560 565
561 566 url = util.url(bytes(defaulturl))
General Comments 0
You need to be logged in to leave comments. Login now