From: Junio C Hamano <gitster@pobox.com>
Date: Wed, 19 Aug 2009 06:32:58 +0000 (-0700)
Subject: Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix'
X-Git-Tag: v1.6.5-rc0~58
X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=09ba7b2d9fc9142a2195082dd0e74c8161b6b744;p=git.git

Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix'

* tr/maint-1.6.3-add-p-modeonly-fix:
  add -p: do not attempt to coalesce mode changes
  git add -p: demonstrate failure when staging both mode and hunk
---

09ba7b2d9fc9142a2195082dd0e74c8161b6b744
diff --cc t/t3701-add-interactive.sh
index fd2a55a5c,63940b189..62fd65e18
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@@ -163,14 -163,19 +163,25 @@@ test_expect_success FILEMODE 'stage mod
  	git diff          file | grep "+content"
  '
  
+ 
+ test_expect_success FILEMODE 'stage mode and hunk' '
+ 	git reset --hard &&
+ 	echo content >>file &&
+ 	chmod +x file &&
+ 	printf "y\\ny\\n" | git add -p &&
+ 	git diff --cached file | grep "new mode" &&
+ 	git diff --cached file | grep "+content" &&
+ 	test -z "$(git diff file)"
+ '
+ 
  # end of tests disabled when filemode is not usable
  
 +test_expect_success 'setup again' '
 +	git reset --hard &&
 +	test_chmod +x file &&
 +	echo content >>file
 +'
 +
  # Write the patch file with a new line at the top and bottom
  cat >patch <<EOF
  index 180b47c..b6f2c08 100644