completion: support restore
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 25 Apr 2019 09:45:56 +0000 (16:45 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 May 2019 04:04:48 +0000 (13:04 +0900)
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>
contrib/completion/git-completion.bash
index b24bc482761368de2fa0da5a97c535dfb21274b6..58d18d41a23f2d33b096c6cd16c1ab11adfab269 100644 (file)
@@ -2491,6 +2491,21 @@ _git_reset ()
        __git_complete_refs
 }
 
+_git_restore ()
+{
+       case "$cur" in
+       --conflict=*)
+               __gitcomp "diff3 merge" "" "${cur##--conflict=}"
+               ;;
+       --source=*)
+               __git_complete_refs --cur="${cur##--source=}"
+               ;;
+       --*)
+               __gitcomp_builtin restore
+               ;;
+       esac
+}
+
 __git_revert_inprogress_options="--continue --quit --abort"
 
 _git_revert ()