From a9aecc7abb52c4dcd616ee8f43ce5741a15e14a6 Mon Sep 17 00:00:00 2001 From: Alexandr Miloslavskiy Date: Tue, 3 Dec 2019 14:02:18 +0000 Subject: [PATCH] checkout, restore: support the --pathspec-from-file option Decisions taken for simplicity: 1) For now, `--pathspec-from-file` is declared incompatible with `--patch`, even when is not `stdin`. Such use case it not really expected. 2) It is not allowed to pass pathspec in both args and file. `you must specify path(s) to restore` block was moved down to be able to test for `pathspec.nr` instead, because testing for `argc` is no longer correct. `git switch` does not support the new options because it doesn't expect `` arguments. Signed-off-by: Alexandr Miloslavskiy Signed-off-by: Junio C Hamano --- Documentation/git-checkout.txt | 15 ++++ Documentation/git-restore.txt | 14 ++++ builtin/checkout.c | 31 +++++++-- t/t2026-checkout-pathspec-file.sh | 139 ++++++++++++++++++++++++++++++++++++++ t/t2072-restore-pathspec-file.sh | 139 ++++++++++++++++++++++++++++++++++++++ t/t9902-completion.sh | 2 + 6 files changed, 336 insertions(+), 4 deletions(-) create mode 100755 t/t2026-checkout-pathspec-file.sh create mode 100755 t/t2072-restore-pathspec-file.sh diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index a2d420ec62..c8fb995fa7 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -13,6 +13,7 @@ SYNOPSIS 'git checkout' [-q] [-f] [-m] [--detach] 'git checkout' [-q] [-f] [-m] [[-b|-B|--orphan] ] [] 'git checkout' [-f|--ours|--theirs|-m|--conflict=