* [PATCH] git-p4: reverse large file detection order
@ 2020-02-28 15:07 Sam Hocevar
0 siblings, 0 replies; only message in thread
From: Sam Hocevar @ 2020-02-28 15:07 UTC (permalink / raw)
To: git
It is more efficient to first check for a file's extension against
git-p4.largeFileExtensions before git-p4.largeFileCompressedThreshold
because the latter test may trigger a costly compression task.
Signed-off-by: Sam Hocevar <sam@hocevar.net>
---
git-p4.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git git-p4.py git-p4.py
index 40d9e7c594..a54970aa74 100755
--- git-p4.py
+++ git-p4.py
@@ -1197,7 +1197,7 @@ def processContent(self, git_mode, relPath, contents):
"""Processes the content of git fast import. This method decides if a
file is stored in the large file system and handles all necessary
steps."""
- if self.exceedsLargeFileThreshold(relPath, contents) or self.hasLargeFileExtension(relPath):
+ if self.hasLargeFileExtension(relPath) or self.exceedsLargeFileThreshold(relPath, contents):
contentTempFile = self.generateTempFile(contents)
(pointer_git_mode, contents, localLargeFile) = self.generatePointer(contentTempFile)
if pointer_git_mode:
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-28 15:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 15:07 [PATCH] git-p4: reverse large file detection order Sam Hocevar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).