completion: support restore

Completion for restore is straightforward. We could still do better though by giving the list of just tracked files instead of all present ones. But let's leave it for later. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Apr 25, 2019 at 16:45 UTC 75f4c7c1eb06cdf6eae1339bbac02dfb620acc11
1 file changed +15
contrib/completion/git-completion.bash
+15
@@ -2491,6 +2491,21 @@ _git_reset ()
2491 __git_complete_refs
2492 }
2493
2494 +_git_restore ()
2495 +{
2496 + case "$cur" in
2497 + --conflict=*)
2498 + __gitcomp "diff3 merge" "" "${cur##--conflict=}"
2499 + ;;
2500 + --source=*)
2501 + __git_complete_refs --cur="${cur##--source=}"
2502 + ;;
2503 + --*)
2504 + __gitcomp_builtin restore
2505 + ;;
2506 + esac
2507 +}
2508 +
2509 __git_revert_inprogress_options="--continue --quit --abort"
2510
2511 _git_revert ()