From: René Scharfe Date: Sat, 1 Oct 2011 15:38:34 +0000 (+0200) Subject: checkout: check for "Previous HEAD" notice in t2020 X-Git-Tag: v1.7.8-rc0~80^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=83933c9832af91a71337e429a6251f1a3b6d6f60;p=git.git checkout: check for "Previous HEAD" notice in t2020 If we leave a detached head, exactly one of two things happens: either checkout warns about it being an orphan or describes it as a courtesy. Test t2020 already checked that the warning is shown as needed. This patch also checks for the description. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh index 2366f0f41..068fba4c8 100755 --- a/t/t2020-checkout-detach.sh +++ b/t/t2020-checkout-detach.sh @@ -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 () {