summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorr.burenkov <panzercheg@gmail.com>2019-12-11 17:47:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-11 17:59:17 (GMT)
commitea94b16fb832d6e0bc2fb8761fd4a89555002bcc (patch)
tree41ebb67974a8e764a2b389dcc134e6097196e971 /git-p4.py
parent53a06cf39b756eddfe4a2a34da93e3d04eb7b728 (diff)
downloadgit-ea94b16fb832d6e0bc2fb8761fd4a89555002bcc.zip
git-ea94b16fb832d6e0bc2fb8761fd4a89555002bcc.tar.gz
git-ea94b16fb832d6e0bc2fb8761fd4a89555002bcc.tar.bz2
git-p4: honor lfs.storage configuration variable
"git lfs" allows users to specify the custom storage location with the configuration variable `lfs.storage`, but when interacting with GitLFS pointers, "git p4" always uses the hardcoded default that is the `.git/lfs/` directory, without paying attention to the configuration. Use the value configured in `lfs.storage`, if exists, as all the "git" operations do, for consistency. Signed-off-by: r.burenkov <panzercheg@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-p4.py b/git-p4.py
index 60c73b6..0b3a07c 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1257,9 +1257,15 @@ class GitLFS(LargeFileSystem):
pointerFile = re.sub(r'Git LFS pointer for.*\n\n', '', pointerFile)
oid = re.search(r'^oid \w+:(\w+)', pointerFile, re.MULTILINE).group(1)
+ # if someone use external lfs.storage ( not in local repo git )
+ lfs_path = gitConfig('lfs.storage')
+ if not lfs_path:
+ lfs_path = 'lfs'
+ if not os.path.isabs(lfs_path):
+ lfs_path = os.path.join(os.getcwd(), '.git', lfs_path)
localLargeFile = os.path.join(
- os.getcwd(),
- '.git', 'lfs', 'objects', oid[:2], oid[2:4],
+ lfs_path,
+ 'objects', oid[:2], oid[2:4],
oid,
)
# LFS Spec states that pointer files should not have the executable bit set.