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>
This commit is contained in:
parent
7f96e2e25a
commit
36bd844658
@ -316,8 +316,11 @@ def gitBranchExists(branch):
|
|||||||
stderr=subprocess.PIPE, stdout=subprocess.PIPE);
|
stderr=subprocess.PIPE, stdout=subprocess.PIPE);
|
||||||
return proc.wait() == 0;
|
return proc.wait() == 0;
|
||||||
|
|
||||||
|
_gitConfig = {}
|
||||||
def gitConfig(key):
|
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):
|
def p4BranchesInGit(branchesAreInRemotes = True):
|
||||||
branches = {}
|
branches = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user