summaryrefslogtreecommitdiff
path: root/t/t5521-pull-options.sh
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder@ira.uka.de>2013-06-17 22:58:42 +0200
committerLibravatar SZEDER Gábor <szeder@ira.uka.de>2013-06-24 17:22:10 +0200
commitefaa0c153297f551a42fd1e21f28f51f4924f316 (patch)
treedba85c59520f912842b9b5c9f9fda8cbc41812a6 /t/t5521-pull-options.sh
parentbash prompt: use bash builtins to find out current branch (diff)
downloadtgif-efaa0c153297f551a42fd1e21f28f51f4924f316.tar.xz
bash prompt: combine 'git rev-parse' executions in the main code path
There are a couple of '$(git rev-parse --<opt>)' command substitutions in __git_ps1() and three of them are executed in the main code path: - the first to get the path to the .git directory ('--git-dir'), - the second to check whether we're inside the .git directory ('--is-inside-git-dir'), - and the last, depending on the results of the second, either * to check whether it's a bare repo ('--is-bare-repository'), or * to check whether inside a work tree ('--is-inside-work-tree'). Naturally, this imposes the overhead of fork()ing three subshells and fork()+exec()ing three git commands. Combine these four 'git rev-parse' queries into a single one and use bash parameter expansions to parse the combined output, i.e. to separate the path to the .git directory from the true/false of '--is-inside-git-dir', etc. This way we can eliminate two of the three subshells and git commands. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Diffstat (limited to 't/t5521-pull-options.sh')
0 files changed, 0 insertions, 0 deletions