diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-11-28 20:12:26 +0300 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-11-29 02:48:55 +0300 |
commit | 67ffa1142585742601011440a17528ef841bbf44 (patch) | |
tree | d4f261c4fc802e74feb237f814dae77932895cfa /ident.c | |
parent | 4548e855e4600a0f76329cf4f0dd9e8d17d66b08 (diff) |
Fix broken bash completion of local refs.
Commit 35e65ecc broke completion of local refs, e.g. "git pull . fo<tab>"
no longer would complete to "foo". Instead it printed out an internal
git error ("fatal: Not a git repository: '.'").
The break occurred when I tried to improve performance by switching from
git-peek-remote to git-for-each-ref. Apparently git-peek-remote will
drop into directory "$1/.git" (where $1 is its first parameter) if it
is given a repository with a working directory. This allowed the bash
completion code to work properly even though it was not handing over
the true repository directory.
So now we do a stat in bash to see if we need to add "/.git" to the
path string before running any command with --git-dir.
I also tried to optimize away two "git rev-parse --git-dir" invocations
in common cases like "git log fo<tab>" as typically the user is in the
top level directory of their project and therefore the .git subdirectory
is in the current working directory. This should make a difference on
systems where fork+exec might take a little while.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ident.c')
0 files changed, 0 insertions, 0 deletions