diff options
author | Ghanshyam Thakkar <shyamthakkar001@gmail.com> | 2024-04-03 23:44:52 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-04-03 14:55:22 -0700 |
commit | 7de13cfef3042478223012841e07cd91d7234d22 (patch) | |
tree | 6f5b7eafcbe609c1b2cd4c15f47c4972c6b20fc9 /builtin/commit.c | |
parent | ac5946e6248eb84458d236099f356e5e09e2482f (diff) |
builtin/add: error out when passing untracked path with -u
When passing untracked path with -u option, it silently succeeds.
There is no error message and the exit code is zero. This is
inconsistent with other instances of git commands where the expected
argument is a known path. In those other instances, we error out when
the path is not known.
Fix this by passing a character array to add_files_to_cache() to
collect the pathspec matching information and report the error if a
pathspec does not match any cache entry. Also add a testcase to cover
this scenario.
Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions