Merge branch 'gt/add-u-commit-i-pathspec-check'

"git add -u <pathspec>" and "git commit [-i] <pathspec>" did not
diagnose a pathspec element that did not match any files in certain
situations, unlike "git add <pathspec>" did.

* gt/add-u-commit-i-pathspec-check:
  builtin/add: error out when passing untracked path with -u
  builtin/commit: error out when passing untracked path with -i
  revision: optionally record matches with pathspec elements
This commit is contained in:
Junio C Hamano
2024-04-15 14:11:43 -07:00
9 changed files with 46 additions and 25 deletions

View File

@@ -882,7 +882,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
* entries in the index.
*/
add_files_to_cache(the_repository, NULL, NULL, 0, 0);
add_files_to_cache(the_repository, NULL, NULL, NULL, 0,
0);
init_merge_options(&o, the_repository);
o.verbosity = 0;
work = write_in_core_index_as_tree(the_repository);