We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bb6644 commit b2f6fd9Copy full SHA for b2f6fd9
t/t7508-status.sh
@@ -703,4 +703,19 @@ test_expect_success 'commit --dry-run submodule summary (--amend)' '
703
test_cmp expect output
704
'
705
706
+test_expect_success POSIXPERM 'status succeeds in a read-only repository' '
707
+ (
708
+ chmod a-w .git &&
709
+ # make dir1/tracked stat-dirty
710
+ >dir1/tracked1 && mv -f dir1/tracked1 dir1/tracked &&
711
+ git status -s >output &&
712
+ ! grep dir1/tracked output &&
713
+ # make sure "status" succeeded without writing index out
714
+ git diff-files | grep dir1/tracked
715
+ )
716
+ status=$?
717
+ chmod 775 .git
718
+ (exit $status)
719
+'
720
+
721
test_done
0 commit comments