]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7508-status.sh
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / t / t7508-status.sh
index 8e969f3e3680d856073460b5b15e524ad9170d7f..45e1f6ff683a0195a63c0a3a7f6d37cf9d97f623 100755 (executable)
@@ -837,7 +837,7 @@ EOF
 '
 
 cat >expect <<EOF
-:100644 100644 $EMPTY_BLOB 0000000000000000000000000000000000000000 M  dir1/modified
+:100644 100644 $EMPTY_BLOB $ZERO_OID M dir1/modified
 EOF
 test_expect_success 'status refreshes the index' '
        touch dir2/added &&
@@ -846,6 +846,18 @@ test_expect_success 'status refreshes the index' '
        test_cmp expect output
 '
 
+test_expect_success 'status shows detached HEAD properly after checking out non-local upstream branch' '
+       test_when_finished rm -rf upstream downstream actual &&
+
+       test_create_repo upstream &&
+       test_commit -C upstream foo &&
+
+       git clone upstream downstream &&
+       git -C downstream checkout @{u} &&
+       git -C downstream status >actual &&
+       test_i18ngrep "HEAD detached at [0-9a-f]\\+" actual
+'
+
 test_expect_success 'setup status submodule summary' '
        test_create_repo sm && (
                cd sm &&