summaryrefslogtreecommitdiff
path: root/t/t2020-checkout-detach.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2011-10-01 15:38:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-03 18:02:25 (GMT)
commit83933c9832af91a71337e429a6251f1a3b6d6f60 (patch)
tree3790df6585ede74fb27d3c28281adbd4a8225d10 /t/t2020-checkout-detach.sh
parentf696543dad6c7ba27b0c4fab167a5687263a9ba0 (diff)
downloadgit-83933c9832af91a71337e429a6251f1a3b6d6f60.zip
git-83933c9832af91a71337e429a6251f1a3b6d6f60.tar.gz
git-83933c9832af91a71337e429a6251f1a3b6d6f60.tar.bz2
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 <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2020-checkout-detach.sh')
-rwxr-xr-xt/t2020-checkout-detach.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index 2366f0f..068fba4 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 () {