threads / patch / 49391

patchcompletion: support "git fetch --multiple"

Subject: [PATCH] completion: support "git fetch --multiple"

## tl;dr

One message between Sep 20, 2018 and Sep 20, 2018. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Nguyễn Thái Ngọc Duy· Sep 20, 2018, 16:37 UTC · lore

When --multiple is given, the remaining arguments are remote names, not one remote followed by zero or more refspec. Detect this case, disable refspec completion, and pretend no remote is seen in order to complete multiple of them.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 contrib/completion/git-completion.bash | 1 +
 1 file changed, 1 insertion(+)
Show changes to contrib/completion/git-completion.bash +1 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d63d2dffd4..a66bec966b 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -943,6 +943,7 @@ __git_complete_remote_or_refspec ()
 			*) ;;
 			esac
 			;;
+		--multiple) no_complete_refspec=1; break ;;
 		-*) ;;
 		*) remote="$i"; break ;;
 		esac
-- 
2.19.0.rc0.337.ge906d732e7

← back to recent threads