diff options
author | John Chapman <thestar@fussycoder.id.au> | 2008-11-08 14:22:49 +1100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-11 14:50:03 -0800 |
commit | 36bd844658cf244ec2c6756c18673a4b7ed8ec9e (patch) | |
tree | 7476047334482bc81b24bca511023a553e7d79be /contrib/fast-import/git-p4 | |
parent | git-p4: Support purged files and optimize memory usage (diff) | |
download | tgif-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-x | contrib/fast-import/git-p4 | 5 |
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 = {} |