##// 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 https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md
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 '')
542 lfsurl = repo.ui.config('lfs', 'url')
543 if url.scheme is None:
543 url = util.url(lfsurl or '')
544 if lfsurl is None:
544 if remote:
545 if remote:
545 defaulturl = util.url(remote)
546 path = remote
546 elif util.safehasattr(repo, '_subtoppath'):
547 elif util.safehasattr(repo, '_subtoppath'):
547 # The pull command sets this during the optional update phase, which
548 # The pull command sets this during the optional update phase, which
548 # tells exactly where the pull originated, whether 'paths.default'
549 # tells exactly where the pull originated, whether 'paths.default'
549 # or explicit.
550 # or explicit.
550 defaulturl = util.url(repo._subtoppath)
551 path = repo._subtoppath
551 else:
552 else:
552 # TODO: investigate 'paths.remote:lfsurl' style path customization,
553 # TODO: investigate 'paths.remote:lfsurl' style path customization,
553 # and fall back to inferring from 'paths.remote' if unspecified.
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 # TODO: support local paths as well.
559 # TODO: support local paths as well.
557 # TODO: consider the ssh -> https transformation that git applies
560 # TODO: consider the ssh -> https transformation that git applies
558 if defaulturl.scheme in (b'http', b'https'):
561 if defaulturl.scheme in (b'http', b'https'):
562 if defaulturl.path and defaulturl.path[:-1] != b'/':
563 defaulturl.path += b'/'
559 defaulturl.path = defaulturl.path or b'' + b'.git/info/lfs'
564 defaulturl.path = defaulturl.path or b'' + b'.git/info/lfs'
560
565
561 url = util.url(bytes(defaulturl))
566 url = util.url(bytes(defaulturl))
General Comments 0
You need to be logged in to leave comments. Login now