mbox series

[0/2] enhance "git restore --worktree --staged" behavior

Message ID 20200501082746.23943-1-sunshine@sunshineco.com (mailing list archive)
Headers show
Series enhance "git restore --worktree --staged" behavior | expand

Message

Eric Sunshine May 1, 2020, 8:27 a.m. UTC
This series addresses a shortcoming or two when git-restore's --worktree
and --staged options are combined. The first patch tightens the
implementation to match the documentation. The second patch loosens the
documented restriction by adding a bit of DWIMing to make it more
convenient to combine the two options.

Although the second patch effectively throws away the changes of the
first patch, I kept them separate in case someone comes up with a good
objection to the new DWIMing (which escaped me), in which case the first
patch can be kept and the second thrown away.

Eric Sunshine (2):
  restore: require --source when combining --worktree and --staged
  restore: default to HEAD when combining --worktree and --staged

 Documentation/git-restore.txt | 13 +++++++------
 builtin/checkout.c            |  6 +++---
 t/t2070-restore.sh            | 11 +++++++++++
 3 files changed, 21 insertions(+), 9 deletions(-)