summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-09 07:29:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-09 07:29:24 (GMT)
commitce47dc077549d4952908a5377ab36474b2bd8446 (patch)
tree9b568c44db1488c2eb636bca33d0395f9545f25f /t
parentba9f517bdd2062d1d90d37e5b10d1688d48bc225 (diff)
parentca7246864b43e9ea1922cc5386225ecd1b3bdd98 (diff)
downloadgit-ce47dc077549d4952908a5377ab36474b2bd8446.zip
git-ce47dc077549d4952908a5377ab36474b2bd8446.tar.gz
git-ce47dc077549d4952908a5377ab36474b2bd8446.tar.bz2
Merge branch 'jk/add-i-mode'
* jk/add-i-mode: add--interactive: allow user to choose mode update add--interactive: ignore mode change in 'p'atch command
Diffstat (limited to 't')
-rwxr-xr-xt/t3701-add-interactive.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 77c90f6..f15be93 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -66,4 +66,23 @@ test_expect_success 'revert works (commit)' '
grep "unchanged *+3/-0 file" output
'
+test_expect_success 'patch does not affect mode' '
+ git reset --hard &&
+ echo content >>file &&
+ chmod +x file &&
+ 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