do_for_each_reflog(): return early on error
[gitweb.git] / t / t2020-checkout-detach.sh
index 2366f0f4141656666db9cdcd8975335df57b6a8f..b37ce25c42cd2fb0e2868c19f66902b319526de2 100755 (executable)
@@ -12,11 +12,14 @@ check_not_detached () {
 }
 
 ORPHAN_WARNING='you are leaving .* commit.*behind'
+PREV_HEAD_DESC='Previous HEAD position was'
 check_orphan_warning() {
-       test_i18ngrep "$ORPHAN_WARNING" "$1"
+       test_i18ngrep "$ORPHAN_WARNING" "$1" &&
+       test_i18ngrep ! "$PREV_HEAD_DESC" "$1"
 }
 check_no_orphan_warning() {
-       test_i18ngrep ! "$ORPHAN_WARNING" "$1"
+       test_i18ngrep ! "$ORPHAN_WARNING" "$1" &&
+       test_i18ngrep "$PREV_HEAD_DESC" "$1"
 }
 
 reset () {
@@ -145,7 +148,7 @@ test_expect_success 'tracking count is accurate after orphan check' '
        git config branch.child.merge refs/heads/master &&
        git checkout child^ &&
        git checkout child >stdout &&
-       test_cmp expect stdout
+       test_i18ncmp expect stdout
 '
 
 test_done