summaryrefslogtreecommitdiff
path: root/contrib/fast-import/git-p4
diff options
context:
space:
mode:
authorLibravatar John Chapman <thestar@fussycoder.id.au>2008-11-08 14:22:49 +1100
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-11-11 14:50:03 -0800
commit36bd844658cf244ec2c6756c18673a4b7ed8ec9e (patch)
tree7476047334482bc81b24bca511023a553e7d79be /contrib/fast-import/git-p4
parentgit-p4: Support purged files and optimize memory usage (diff)
downloadtgif-36bd844658cf244ec2c6756c18673a4b7ed8ec9e.tar.xz
git-p4: Cache git config for performance
This makes git-p4 noticibly faster on Windows. Signed-off-by: John Chapman <thestar@fussycoder.id.au> Acked-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/fast-import/git-p4')
-rwxr-xr-xcontrib/fast-import/git-p45
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 38d1a17333..9f0a5f92c1 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -316,8 +316,11 @@ def gitBranchExists(branch):
stderr=subprocess.PIPE, stdout=subprocess.PIPE);
return proc.wait() == 0;
+_gitConfig = {}
def gitConfig(key):
- return read_pipe("git config %s" % key, ignore_error=True).strip()
+ if not _gitConfig.has_key(key):
+ _gitConfig[key] = read_pipe("git config %s" % key, ignore_error=True).strip()
+ return _gitConfig[key]
def p4BranchesInGit(branchesAreInRemotes = True):
branches = {}