1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 07:06:09 +02:00
git/builtin
Ghanshyam Thakkar 7de13cfef3 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>
2024-04-03 14:55:22 -07:00
..
add.c builtin/add: error out when passing untracked path with -u 2024-04-03 14:55:22 -07:00
am.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
annotate.c
apply.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
archive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
bisect.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
blame.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
branch.c Merge branch 'kh/branch-ref-syntax-advice' 2024-03-15 16:05:59 -07:00
bugreport.c bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option 2024-03-16 09:31:42 -07:00
bundle.c Merge branch 'rs/bundle-parseopt-cleanup' 2023-08-07 11:57:18 -07:00
cat-file.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
check-attr.c check-attr: integrate with sparse-index 2023-08-11 09:44:52 -07:00
check-ignore.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
check-mailmap.c builtin.h: remove unneccessary includes 2023-06-21 13:39:54 -07:00
check-ref-format.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
checkout--worker.c git-compat-util: move alloc macros to git-compat-util.h 2023-07-05 11:42:31 -07:00
checkout-index.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
checkout.c revision: optionally record matches with pathspec elements 2024-04-03 14:55:21 -07:00
clean.c clean: further clean-up of implementation around "--force" 2024-03-04 14:05:13 -08:00
clone.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
column.c column: disallow negative padding 2024-02-13 10:18:50 -08:00
commit-graph.c Merge branch 'ja/doc-placeholders-fix' 2024-02-08 13:20:34 -08:00
commit-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
commit.c builtin/commit: error out when passing untracked path with -i 2024-04-03 14:55:22 -07:00
config.c config: add back code comment 2024-01-29 10:27:53 -08:00
count-objects.c count-objects: mark unused parameter in alternates callback 2023-07-13 17:24:00 -07:00
credential-cache--daemon.c git-compat-util: move alloc macros to git-compat-util.h 2023-07-05 11:42:31 -07:00
credential-cache.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
credential-store.c Merge branch 'cw/strbuf-cleanup' 2023-07-06 11:54:46 -07:00
credential.c builtins: mark unused prefix parameters 2023-03-28 14:11:24 -07:00
describe.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diagnose.c object-file.h: move declarations for object-file.c functions from cache.h 2023-04-11 08:52:10 -07:00
diff-files.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-index.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
difftool.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
fast-export.c use xstrncmpz() 2024-02-12 09:32:41 -08:00
fast-import.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
fetch-pack.c git-compat-util: move alloc macros to git-compat-util.h 2023-07-05 11:42:31 -07:00
fetch.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
fmt-merge-msg.c treewide: remove unnecessary includes for wrapper.h 2023-07-05 11:41:59 -07:00
for-each-ref.c for-each-ref: add new option to include root refs 2024-02-23 10:36:28 -08:00
for-each-repo.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
fsck.c refs: drop unused params from the reflog iterator callback 2024-02-21 09:58:06 -08:00
fsmonitor--daemon.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
gc.c maintenance: use XDG config if it exists 2024-01-18 12:17:42 -08:00
get-tar-commit-id.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
grep.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
hash-object.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
help.c Merge branch 'gc/config-context' 2023-07-06 11:54:48 -07:00
hook.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
index-pack.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
init-db.c Merge branch 'ps/refstorage-extension' 2024-01-16 10:11:57 -08:00
interpret-trailers.c Merge branch 'ja/doc-formatting-fix' 2024-03-25 16:16:34 -07:00
log.c commit-reach(repo_get_merge_bases_many): pass on "missing commits" errors 2024-02-29 08:06:01 -08:00
ls-files.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
ls-remote.c Merge branch 'en/header-cleanup' 2024-01-08 14:05:15 -08:00
ls-tree.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
mailinfo.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
mailsplit.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
merge-base.c commit-reach(repo_get_merge_bases_many_dirty): pass on errors 2024-02-29 08:06:01 -08:00
merge-file.c merge-file: add --diff-algorithm option 2023-11-22 14:23:06 +09:00
merge-index.c read-cache*.h: move declarations for read-cache.c functions from cache.h 2023-06-21 13:39:53 -07:00
merge-ours.c diff.h: remove unnecessary include of oidset.h 2023-06-21 13:39:53 -07:00
merge-recursive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
merge-tree.c Merge branch 'js/merge-base-with-missing-commit' 2024-03-11 14:12:30 -07:00
merge.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
mktag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
mktree.c git-compat-util: move alloc macros to git-compat-util.h 2023-07-05 11:42:31 -07:00
multi-pack-index.c Merge branch 'gc/config-context' 2023-07-06 11:54:48 -07:00
mv.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
name-rev.c name-rev: use mem_pool_strfmt() 2024-02-26 09:35:40 -08:00
notes.c Merge branch 'js/check-null-from-read-object-file' 2024-02-14 15:36:06 -08:00
pack-objects.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
pack-redundant.c object-store-ll.h: split this header out of object-store.h 2023-06-21 13:39:54 -07:00
pack-refs.c pack-refs: teach pack-refs --include option 2023-05-12 14:54:14 -07:00
patch-id.c Merge branch 'gc/config-context' 2023-07-06 11:54:48 -07:00
prune-packed.c treewide: be explicit about dependence on gettext.h 2023-03-21 10:56:51 -07:00
prune.c Merge branch 'en/header-split-cache-h-part-3' 2023-06-29 16:43:21 -07:00
pull.c commit-reach(get_octopus_merge_bases): pass on "missing commits" errors 2024-02-29 08:06:01 -08:00
push.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
range-diff.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
read-tree.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
rebase.c Merge branch 'pw/rebase-i-ignore-cherry-pick-help-environment' 2024-03-18 13:04:25 -07:00
receive-pack.c commit-reach(repo_in_merge_bases_many): report missing commits 2024-02-28 09:47:03 -08:00
reflog.c Merge branch 'ps/reflog-list' into HEAD 2024-03-01 14:38:55 -08:00
remote-ext.c builtins: annotate always-empty prefix parameters 2023-03-28 14:11:24 -07:00
remote-fd.c builtins: annotate always-empty prefix parameters 2023-03-28 14:11:24 -07:00
remote.c builtin/remote.c: trivial fix of error message 2024-03-05 14:11:56 -08:00
repack.c repack: check error writing to pack-objects subprocess 2024-03-02 11:12:16 -08:00
replace.c replace: mark unused parameter in each_mergetag_fn callback 2023-07-13 17:24:00 -07:00
replay.c replay: stop assuming replayed branches do not diverge 2023-11-26 10:10:50 +09:00
rerere.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
reset.c Merge branch 'js/merge-tree-3-trees' 2024-03-07 15:59:41 -08:00
rev-list.c rev-list: allow missing tips with --missing=[print|allow*] 2024-02-14 09:39:14 -08:00
rev-parse.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
revert.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
rm.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
send-pack.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
shortlog.c diff.h: remove unnecessary include of oidset.h 2023-06-21 13:39:53 -07:00
show-branch.c Merge branch 'jc/parse-options-show-branch' 2023-07-27 15:26:37 -07:00
show-index.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
show-ref.c Merge branch 'tc/show-ref-exists-fix' into maint-2.43 2024-02-13 14:44:47 -08:00
sparse-checkout.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
stash.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
stripspace.c Merge branch 'cw/strbuf-cleanup' 2023-07-06 11:54:46 -07:00
submodule--helper.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
symbolic-ref.c git-compat-util: move strbuf.c funcs to its header 2023-07-05 11:41:18 -07:00
tag.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
unpack-file.c treewide: remove unnecessary includes for wrapper.h 2023-07-05 11:41:59 -07:00
unpack-objects.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
update-index.c Merge branch 'jc/unresolve-removal' 2023-10-02 11:20:00 -07:00
update-ref.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
update-server-info.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00
upload-archive.c repository: remove unnecessary include of path.h 2023-06-21 13:39:53 -07:00
upload-pack.c upload-pack: always turn off save_commit_buffer 2024-02-28 14:42:01 -08:00
var.c config: rename global config function 2024-01-18 12:17:41 -08:00
verify-commit.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
verify-pack.c builtin.h: remove unneccessary includes 2023-06-21 13:39:54 -07:00
verify-tag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
worktree.c Merge branch 'jc/comment-style-fixes' into maint-2.43 2024-02-13 14:44:48 -08:00
write-tree.c cache.h: remove this no-longer-used header 2023-06-21 13:39:53 -07:00