[PATCH 03/19] completion: use __gitdir() in _git_log()
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- May 9, 2012, 00:44 UTC
- Message-ID
- <1336524290-30023-4-git-send-email-szeder@ira.uka.de>
- In-Reply-To
- <1336524290-30023-1-git-send-email-szeder@ira.uka.de>
The standard way to find out the path to the repository in the completion script is the __gitdir() helper function, because that handles the repository path given on the command line (i.e. git --git-dir=/path/to/repo log --<TAB>). However, there is one exception: the completion function for 'git log' still uses 'git rev-parse --git-dir' directly, and could offer (or not) the '--merge' option erroneously when the repository is specified on the command line.
Use __gitdir() there, too.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 9f56ec7a..f17abccb 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1551,7 +1551,7 @@ _git_log () { __git_has_doubledash && return - local g="$(git rev-parse --git-dir 2>/dev/null)" + local g="$(__gitdir)" local merge="" if [ -f "$g/MERGE_HEAD" ]; then merge="--merge"
-- 1.7.10.1.541.gb1be298