# HG changeset patch
# User Matt Harbison <matt_harbi...@yahoo.com>
# Date 1523643390 14400
#      Fri Apr 13 14:16:30 2018 -0400
# Node ID 414fdd730760f960aaa9b9e8cfb7853b543c8fca
# Parent  f5420feae687abf2e16e8444c385bdac9eedfeab
lfs: fix the inferred remote store path when using a --prefix

This wasn't appending the '.git/info/lfs' path in this case.

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -561,7 +561,7 @@ def remote(repo, remote=None):
         if defaulturl.scheme in (b'http', b'https'):
             if defaulturl.path and defaulturl.path[:-1] != b'/':
                 defaulturl.path += b'/'
-            defaulturl.path = defaulturl.path or b'' + b'.git/info/lfs'
+            defaulturl.path = (defaulturl.path or b'') + b'.git/info/lfs'
 
             url = util.url(bytes(defaulturl))
             repo.ui.note(_('lfs: assuming remote store: %s\n') % url)
diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t
--- a/tests/test-lfs-serve-access.t
+++ b/tests/test-lfs-serve-access.t
@@ -73,8 +73,7 @@ Blob URIs are correct when --prefix is u
   >    -A $TESTTMP/access.log -E $TESTTMP/errors.log
   $ cat hg.pid >> $DAEMON_PIDS
 
-  $ hg --config 
lfs.url=http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs \
-  >    clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
+  $ hg clone --debug http://localhost:$HGPORT/subdir/mount/point cloned2
   using http://localhost:$HGPORT/subdir/mount/point
   sending capabilities command
   query 1; heads
@@ -104,6 +103,7 @@ Blob URIs are correct when --prefix is u
   resolving manifests
    branchmerge: False, force: False, partial: False
    ancestor: 000000000000, local: 000000000000+, remote: 525251863cad
+  lfs: assuming remote store: 
http://localhost:$HGPORT/subdir/mount/point/.git/info/lfs
   Status: 200
   Content-Length: 371
   Content-Type: application/vnd.git-lfs+json
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to