From: John Keeping Date: Tue, 22 Jul 2014 18:24:58 GMT Subject: [PATCH v2 3/3] completion: complete `git push --force-with-lease=` Message-ID: <90f116e5dc385ed5e85c499d855682720b0e91c7.1406053442.git.john@keeping.me.uk> In-Reply-To: <8303c95dd3e3ee8d77d4b994bb2d33b6a155a17f.1406053442.git.john@keeping.me.uk> Signed-off-by: John Keeping --- contrib/completion/git-completion.bash | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 33a4962..293868a 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1621,6 +1621,22 @@ _git_pull () __git_push_recurse_submodules="check on-demand" +__git_complete_force_with_lease () +{ + local cur_=$1 + + case "$cur_" in + --*=) + ;; + *:*) + __gitcomp_nl "$(__git_refs)" "" "${cur_#*:}" + ;; + *) + __gitcomp_nl "$(__git_refs)" "" "$cur_" + ;; + esac +} + _git_push () { case "$prev" in @@ -1633,6 +1649,10 @@ _git_push () return esac case "$cur" in + --force-with-lease=*) + __git_complete_force_with_lease "${cur##--force-with-lease=}" + return + ;; --repo=*) __gitcomp_nl "$(__git_remotes)" "" "${cur##--repo=}" return @@ -1646,7 +1666,7 @@ _git_push () --all --mirror --tags --dry-run --force --verbose --quiet --prune --delete --follow-tags --receive-pack= --repo= --set-upstream - --recurse-submodules= + --force-with-lease --force-with-lease= --recurse-submodules= " return ;; -- 2.0.1.472.g6f92e5f.dirty