aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohn Chapman <thestar@fussycoder.id.au>2008-11-08 14:22:49 +1100
committerJunio C Hamano <gitster@pobox.com>2008-11-11 14:50:03 -0800
commit36bd844658cf244ec2c6756c18673a4b7ed8ec9e (patch)
tree7476047334482bc81b24bca511023a553e7d79be /contrib
parent7f96e2e25aa008556a4ede7a65de8488eb9890e6 (diff)
downloadgit-36bd844658cf244ec2c6756c18673a4b7ed8ec9e.tar.gz
git-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')
-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 38d1a1733..9f0a5f92c 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 = {}