1
0
mirror of https://github.com/git/git.git synced 2024-11-15 08:53:08 +01:00
git/builtin
Andy Koppe ee8a88826a restore: fault --staged --worktree with merge opts
The 'restore' command already rejects the --merge, --conflict, --ours
and --theirs options when combined with --staged, but accepts them when
--worktree is added as well.

Unfortunately that doesn't appear to do anything useful. The --ours and
--theirs options seem to be ignored when both --staged and --worktree
are given, whereas with --merge or --conflict, the command has the same
effect as if the --staged option wasn't present.

So reject those options with '--staged --worktree' as well, using
opts->accept_ref to distinguish restore from checkout.

Add test for both '--staged' and '--staged --worktree'.

Signed-off-by: Andy Koppe <andy.koppe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-27 09:33:20 -08:00
..
add.c
am.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
annotate.c
apply.c
archive.c
bisect--helper.c Merge branch 'rs/bisect-start-leakfix' into maint-2.38 2022-10-25 17:11:37 -07:00
blame.c
branch.c Merge branch 'rj/branch-edit-desc-unborn' into maint-2.38 2022-10-27 15:24:13 -07:00
bugreport.c
bundle.c
cat-file.c
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c
checkout.c restore: fault --staged --worktree with merge opts 2023-02-27 09:33:20 -08:00
clean.c
clone.c Sync with 2.37.6 2023-02-06 09:43:28 +01:00
column.c
commit-graph.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
commit-tree.c
commit.c commit: avoid writing to global in option callback 2022-10-06 09:58:06 -07:00
config.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
describe.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
diagnose.c builtin/diagnose.c: don't translate the two mode values 2022-09-21 11:53:35 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c
difftool.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
env--helper.c
fast-export.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
fast-import.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
fetch-pack.c list-objects-filter: add and use initializers 2022-09-12 08:38:59 -07:00
fetch.c Merge branch 'jk/list-objects-filter-cleanup' 2022-09-19 14:35:24 -07:00
fmt-merge-msg.c
for-each-ref.c
for-each-repo.c
fsck.c Merge branch 'jk/fsck-on-diet' into maint-2.38 2022-10-25 17:11:33 -07:00
fsmonitor--daemon.c Merge branch 'ah/fsmonitor-daemon-usage-non-l10n' into maint-2.38 2022-10-25 17:11:33 -07:00
gc.c gc: simplify maintenance_task_pack_refs() 2022-10-05 12:46:27 -07:00
get-tar-commit-id.c
grep.c
hash-object.c
help.c git help: special-case scalar 2022-09-02 10:02:56 -07:00
hook.c
index-pack.c
init-db.c
interpret-trailers.c
log.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
ls-files.c ls-files: fix black space in error message 2022-09-12 09:25:40 -07:00
ls-remote.c
ls-tree.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'en/merge-unstash-only-on-clean-merge' into maint 2022-09-13 12:21:11 -07:00
mktag.c
mktree.c
multi-pack-index.c multi-pack-index: avoid writing to global in option callback 2022-10-06 09:56:51 -07:00
mv.c Merge branch 'sy/mv-out-of-cone' 2022-09-19 14:35:23 -07:00
name-rev.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
notes.c notes, remote: show unknown subcommands between `' 2022-09-07 12:06:12 -07:00
pack-objects.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c
push.c
range-diff.c
read-tree.c
rebase.c
receive-pack.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
reflog.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'jk/remote-rename-without-fetch-refspec' into maint-2.38 2022-10-25 17:11:32 -07:00
repack.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
revert.c
rm.c
send-pack.c
shortlog.c
show-branch.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
show-index.c
show-ref.c git-compat-util.h: use "UNUSED", not "UNUSED(var)" 2022-09-01 10:49:48 -07:00
sparse-checkout.c
stash.c Merge branch 'ab/unused-annotation' 2022-09-14 12:56:39 -07:00
stripspace.c
submodule--helper.c Merge branch 'jk/list-objects-filter-cleanup' 2022-09-19 14:35:24 -07:00
symbolic-ref.c
tag.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c
write-tree.c