Commit 7de13cf
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>1 parent ac5946e commit 7de13cf
2 files changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
| |||
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
| 553 | + | |
552 | 554 | | |
553 | 555 | | |
554 | 556 | | |
555 | 557 | | |
556 | | - | |
| 558 | + | |
557 | 559 | | |
558 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
559 | 565 | | |
560 | 566 | | |
561 | 567 | | |
| |||
568 | 574 | | |
569 | 575 | | |
570 | 576 | | |
| 577 | + | |
571 | 578 | | |
572 | 579 | | |
573 | 580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
0 commit comments