This commit is contained in:
parent
a9dd72bb97
commit
db9d6e0ea0
1 changed files with 9 additions and 9 deletions
|
@ -25,26 +25,26 @@ __git_index_files ()
|
||||||
|
|
||||||
time __git_index_files > /dev/null
|
time __git_index_files > /dev/null
|
||||||
|
|
||||||
|
real 0m0.830s
|
||||||
|
user 0m0.597s
|
||||||
|
sys 0m0.310s
|
||||||
|
|
||||||
__git_index_files ()
|
__git_index_files ()
|
||||||
{
|
{
|
||||||
local dir="$(__gitdir)" root="${2-.}" file;
|
local dir="$(__gitdir)" root="${2-.}" file;
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
__git_ls_files_helper "$root" "$1" | \
|
__git_ls_files_helper "$root" "$1" | \
|
||||||
sed -r 's@^"?([^/]+)/.*$@\1@' | sort | uniq
|
sed -r 's@/.*@@' | uniq | sort | uniq
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
time __git_index_files > /dev/null
|
time __git_index_files > /dev/null
|
||||||
|
|
||||||
real 0m0.830s
|
real 0m0.075s
|
||||||
user 0m0.597s
|
user 0m0.083s
|
||||||
sys 0m0.310s
|
sys 0m0.010s
|
||||||
|
|
||||||
real 0m0.345s
|
|
||||||
user 0m0.357s
|
|
||||||
sys 0m0.000s
|
|
||||||
```
|
```
|
||||||
|
|
||||||
So you might redefine `__git_index_files` as above in your .bashrc after sourcing the git autocomplete script.
|
10 times faster! So you might redefine `__git_index_files` as above in your .bashrc after sourcing the git autocomplete script.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue