X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=t%2Ft7508-status.sh;h=008d5711b818a315136290c141c830cdf5af80a0;hb=832ac79edf0e0e9108f5da5b10b496a227667f40;hp=556d0faa77e027c8a18e213088fa6bbc5d7e7af5;hpb=d7173d942ea897b67ac9ba3bab2a0cc374684ca6;p=git.git diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 556d0faa7..008d5711b 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -68,6 +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 @@ test_expect_success 'status (status.showUntrackedFiles no)' ' 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,6 +541,16 @@ test_expect_success 'dry-run of partial commit excluding new file in index' ' test_cmp expect output ' +cat >expect <output && + test_cmp expect output +' + test_expect_success 'setup status submodule summary' ' test_create_repo sm && ( cd sm && @@ -693,4 +748,19 @@ test_expect_success 'commit --dry-run submodule summary (--amend)' ' 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