mbox series

[0/2] fix certain cases of add and commit with untracked path not erroring out

Message ID 20240318155219.494206-2-shyamthakkar001@gmail.com (mailing list archive)
Headers show
Series fix certain cases of add and commit with untracked path not erroring out | expand

Message

Ghanshyam Thakkar March 18, 2024, 3:51 p.m. UTC
While adding tests for 'commit --include', I accidentally reproduced a
potential bug where in we do not error out when passing a pathspec which
does not match any tracked path. This was noticed by Junio while
reviewing[1]. This patch series fixes that and a similar case in 'add
--update'.

[1]: https://lore.kernel.org/git/xmqqil41avcc.fsf@gitster.g/

Ghanshyam Thakkar (2):
  builtin/commit: error out when passing untracked path with -i
  builtin/add: error out when passing untracked path with -u

 builtin/add.c                            | 16 ++++++++++++++++
 builtin/commit.c                         | 15 +++++++++++++++
 t/t1092-sparse-checkout-compatibility.sh |  4 ----
 t/t2200-add-update.sh                    |  5 +++++
 t/t7501-commit-basic-functionality.sh    | 16 +---------------
 5 files changed, 37 insertions(+), 19 deletions(-)