Merge branch 'mg/advice-statushints' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2010 23:23:42 +0000 (16:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Jun 2010 23:23:42 +0000 (16:23 -0700)
* mg/advice-statushints:
wt-status: take advice.statusHints seriously
t7508: test advice.statusHints

1  2 
t/t7508-status.sh
diff --combined t/t7508-status.sh
index a9df7ff7bd0efd987a83f180122873996d866436,1301ec87e929b75717ba69f48b8e3016b56acb6c..008d5711b818a315136290c141c830cdf5af80a0
@@@ -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 <<EOF
+ # On branch master
+ # Changes to be committed:
+ #     new file:   dir2/added
+ #
+ # Changed but not updated:
+ #     modified:   dir1/modified
+ #
+ # Untracked files not listed
+ EOF
+ git config advice.statusHints false
+ test_expect_success 'status -uno (advice.statusHints false)' '
+       git status -uno >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 <<EOF
 +:100644 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0000000000000000000000000000000000000000 M    dir1/modified
 +EOF
 +test_expect_success 'status refreshes the index' '
 +      touch dir2/added &&
 +      git status &&
 +      git diff-files >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