Skip to content

Commit 10c89a0

Browse files
Matthew McClaingitster
authored andcommitted
git-p4 shouldn't attempt to store symlinks in LFS
git-p4.py would attempt to put a symlink in LFS if its file extension matched git-p4.largeFileExtensions. Git LFS doesn't store symlinks because smudge/clean filters don't handle symlinks. They never get passed to the filter process nor the smudge/clean filters, nor could that occur without a change to the protocol or command-line interface. Unless Git learned how to send them to the filters, Git LFS would have a hard time using them in any useful way. Git LFS's goal is to move large files out of the repository history, and symlinks are functionally limited to 4 KiB or a similar size on most systems. Signed-off-by: Matthew McClain <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43c8a30 commit 10c89a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-p4.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,6 +1522,10 @@ def processContent(self, git_mode, relPath, contents):
15221522
file is stored in the large file system and handles all necessary
15231523
steps.
15241524
"""
1525+
# symlinks aren't processed by smudge/clean filters
1526+
if git_mode == "120000":
1527+
return (git_mode, contents)
1528+
15251529
if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
15261530
contentTempFile = self.generateTempFile(contents)
15271531
pointer_git_mode, contents, localLargeFile = self.generatePointer(contentTempFile)

0 commit comments

Comments
 (0)