From: Junio C Hamano Date: Wed, 16 Jun 2010 23:23:42 +0000 (-0700) Subject: Merge branch 'mg/advice-statushints' into maint X-Git-Tag: v1.7.2-rc0~63^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2b7d947b8f57f377b24bc2e802d0af67ff911d6f?ds=inline;hp=-c Merge branch 'mg/advice-statushints' into maint * mg/advice-statushints: wt-status: take advice.statusHints seriously t7508: test advice.statusHints --- 2b7d947b8f57f377b24bc2e802d0af67ff911d6f diff --combined t/t7508-status.sh index a9df7ff7bd,1301ec87e9..008d5711b8 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@@ -68,6 -68,34 +68,34 @@@ test_expect_success 'status (2)' ' + cat >expect <<\EOF + # On branch master + # Changes to be committed: + # new file: dir2/added + # + # Changed but not updated: + # modified: dir1/modified + # + # Untracked files: + # dir1/untracked + # dir2/modified + # dir2/untracked + # expect + # output + # untracked + EOF + + git config advice.statusHints false + + test_expect_success 'status (advice.statusHints false)' ' + + git status >output && + test_cmp expect output + + ' + + git config --unset advice.statusHints + cat >expect <<\EOF M dir1/modified A dir2/added @@@ -115,6 -143,23 +143,23 @@@ test_expect_success 'status (status.sho test_cmp expect output ' + cat >expect <output && + test_cmp expect output + ' + git config --unset advice.statusHints + cat >expect << EOF M dir1/modified A dir2/added @@@ -496,16 -541,6 +541,16 @@@ test_expect_success 'dry-run of partia test_cmp expect output ' +cat >expect <output && + test_cmp expect output +' + test_expect_success 'setup status submodule summary' ' test_create_repo sm && ( cd sm && @@@ -703,19 -738,4 +748,19 @@@ test_expect_success 'commit --dry-run s test_cmp expect output ' +test_expect_success POSIXPERM 'status succeeds in a read-only repository' ' + ( + chmod a-w .git && + # make dir1/tracked stat-dirty + >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked && + git status -s >output && + ! grep dir1/tracked output && + # make sure "status" succeeded without writing index out + git diff-files | grep dir1/tracked + ) + status=$? + chmod 775 .git + (exit $status) +' + test_done