diff options
author | Jeff King <peff@peff.net> | 2008-03-27 03:32:25 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-27 13:54:57 -0700 |
commit | ca7246864b43e9ea1922cc5386225ecd1b3bdd98 (patch) | |
tree | 9f38aee689bd5301e247ae146d6e8d6270bed335 /t/t3701-add-interactive.sh | |
parent | add--interactive: ignore mode change in 'p'atch command (diff) | |
download | tgif-ca7246864b43e9ea1922cc5386225ecd1b3bdd98.tar.xz |
add--interactive: allow user to choose mode update
When using the 'p'atch command, instead of just throwing out any mode
change, present it to the user in the same way that we show hunks.
This way, the mode change can be staged independently from the changes
to the contents.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-x | t/t3701-add-interactive.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh index d920d06d5a..f15be93e77 100755 --- a/t/t3701-add-interactive.sh +++ b/t/t3701-add-interactive.sh @@ -70,9 +70,19 @@ test_expect_success 'patch does not affect mode' ' git reset --hard && echo content >>file && chmod +x file && - printf "y\\n" | git add -p && + printf "n\\ny\\n" | git add -p && git show :file | grep content && git diff file | grep "new mode" ' +test_expect_success 'stage mode but not hunk' ' + git reset --hard && + echo content >>file && + chmod +x file && + printf "y\\nn\\n" | git add -p && + git diff --cached file | grep "new mode" && + git diff file | grep "+content" +' + + test_done |