Skip to content

Commit 69ef3c0

Browse files
felipecgitster
authored andcommitted
completion: add missing general options
And add relevant tests. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3954068 commit 69ef3c0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,8 +2640,10 @@ _git ()
26402640
--version
26412641
--exec-path
26422642
--html-path
2643+
--info-path
26432644
--work-tree=
26442645
--namespace=
2646+
--no-replace-objects
26452647
--help
26462648
"
26472649
;;

t/t9902-completion.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,10 @@ test_expect_success 'double dash "git" itself' '
180180
--version Z
181181
--exec-path Z
182182
--html-path Z
183+
--info-path Z
183184
--work-tree=
184185
--namespace=
186+
--no-replace-objects Z
185187
--help Z
186188
EOF
187189
test_completion "git --"
@@ -202,4 +204,18 @@ test_expect_success 'double dash "git checkout"' '
202204
test_completion "git checkout --"
203205
'
204206

207+
test_expect_success 'general options' '
208+
test_completion "git --ver" "--version " &&
209+
test_completion "git --hel" "--help " &&
210+
test_completion "git --exe" "--exec-path " &&
211+
test_completion "git --htm" "--html-path " &&
212+
test_completion "git --pag" "--paginate " &&
213+
test_completion "git --no-p" "--no-pager " &&
214+
test_completion "git --git" "--git-dir=" &&
215+
test_completion "git --wor" "--work-tree=" &&
216+
test_completion "git --nam" "--namespace=" &&
217+
test_completion "git --bar" "--bare " &&
218+
test_completion "git --inf" "--info-path " &&
219+
test_completion "git --no-r" "--no-replace-objects "
220+
'
205221
test_done

0 commit comments

Comments
 (0)