diff options
| author | Daniel Shahaf <danielsh@apache.org> | 2020-01-16 16:42:20 +0000 |
|---|---|---|
| committer | Daniel Shahaf <danielsh@apache.org> | 2020-01-17 21:52:45 +0000 |
| commit | bcd78756c8d55b1bab3a9f6fa79eb58782d3000e (patch) | |
| tree | 00ae2d2d8fa7125541a60a329cc4ddce3a63e9f6 /Completion/Unix/Command | |
| parent | 45304: Do execute the always block even when the try/always block itself is t... (diff) | |
| download | zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar.gz zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar.bz2 zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar.lz zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar.xz zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.tar.zst zsh-bcd78756c8d55b1bab3a9f6fa79eb58782d3000e.zip | |
45313: _git: Support completion from outside of a worktree when --git-dir/--work-tree are specified on the command line
Revised version of workers/41523.
Diffstat (limited to 'Completion/Unix/Command')
| -rw-r--r-- | Completion/Unix/Command/_git | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 8e0d57789..92b72b936 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -7075,21 +7075,23 @@ __git_files_relative () { (( $+functions[__git_files] )) || __git_files () { - local compadd_opts opts tag description gitcdup gitprefix files expl + local compadd_opts opts tag description gittoplevel gitprefix files expl zparseopts -D -E -a compadd_opts V+: J+: 1 2 o+: n f x+: X+: M+: P: S: r: R: q F: zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed x+: --exclude+: tag=$1 description=$2; shift 2 - gitcdup=$(_call_program gitcdup git rev-parse --show-cdup 2>/dev/null) + gittoplevel=$(_call_program toplevel git rev-parse --show-toplevel 2>/dev/null) __git_command_successful $pipestatus || return 1 + [[ -n $gittoplevel ]] && gittoplevel+="/" gitprefix=$(_call_program gitprefix git rev-parse --show-prefix 2>/dev/null) __git_command_successful $pipestatus || return 1 # TODO: --directory should probably be added to $opts when --others is given. - local pref=$gitcdup$gitprefix$PREFIX |
