Skip to content

Commit 20aa6d8

Browse files
committed
Merge branch 'rb/p4-lfs'
"git p4" used to ignore lfs.storage configuration variable, which has been corrected. * rb/p4-lfs: git-p4: honor lfs.storage configuration variable
2 parents fcd5b55 + ea94b16 commit 20aa6d8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

git-p4.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,9 +1257,15 @@ def generatePointer(self, contentFile):
12571257
pointerFile = re.sub(r'Git LFS pointer for.*\n\n', '', pointerFile)
12581258

12591259
oid = re.search(r'^oid \w+:(\w+)', pointerFile, re.MULTILINE).group(1)
1260+
# if someone use external lfs.storage ( not in local repo git )
1261+
lfs_path = gitConfig('lfs.storage')
1262+
if not lfs_path:
1263+
lfs_path = 'lfs'
1264+
if not os.path.isabs(lfs_path):
1265+
lfs_path = os.path.join(os.getcwd(), '.git', lfs_path)
12601266
localLargeFile = os.path.join(
1261-
os.getcwd(),
1262-
'.git', 'lfs', 'objects', oid[:2], oid[2:4],
1267+
lfs_path,
1268+
'objects', oid[:2], oid[2:4],
12631269
oid,
12641270
)
12651271
# LFS Spec states that pointer files should not have the executable bit set.

0 commit comments

Comments
 (0)