summaryrefslogtreecommitdiff
path: root/t/unit-tests
diff options
context:
space:
mode:
authorGhanshyam Thakkar <shyamthakkar001@gmail.com>2024-01-17 21:43:54 +0530
committerJunio C Hamano <gitster@pobox.com>2024-01-17 13:31:15 -0800
commit4e4f576b0690ba039cc0db40e68ee4143acc9a4c (patch)
treec963dfdbc78fc193607b8d793e91075fd1137d46 /t/unit-tests
parenta54a84b333adbecf7bc4483c0e36ed5878cac17b (diff)
t7501: add tests for --include and --only
Add tests for --only (-o) and --include (-i). This include testing with or without staged changes for both -i and -o. Also to test for committing untracked files with -i, -o and without -i/-o. Some tests already exist in t7501 for testing --only, however, it is only tested in combination with --amend and --allow-empty and on to-be-born branch. The addition of these tests check, when the pathspec is provided without using -only, that only the files matching the pathspec get committed. This behavior is same when we provide --only and it is checked by the tests. (as --only is the default mode of operation when pathspec is provided.) As for --include, there is no prior test for checking if --include also commits staged changes, thus add test for that. Along with the tests also document a potential bug, in which, when provided with -i and a pathspec that does not match any tracked path, commit does not fail if there are staged changes. And when there are no staged changes commit fails. However, no error is returned to stderr in either of the cases. This is described in the TODO comment before the relevent testcase. And also add a test for checking incompatibilty when using -o and -i together. Thus, these tests belong in t7501 with other similar existing tests, as described in the case of --only. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
0 files changed, 0 insertions, 0 deletions