summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-05 00:56:36 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-05 00:56:36 +0100
commit244a7da76c07975d807da32de824ab3e3ee55478 (patch)
tree8053493025a921c25f4c95d14e417d7e85c4553e /tests
parente46e00b34f626b3a9508c40d4133f7ece1bb43cd (diff)
test suite: checkout: Check we end up on the right branch each time
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests/checkout10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tests/checkout b/tests/tests/checkout
index bc3d6ef..756c49b 100755
--- a/tests/tests/checkout
+++ b/tests/tests/checkout
@@ -5,6 +5,11 @@ t-tstunt-parsechangelog
t-setup-import examplegit
+now-on () {
+ local branch=$(git symbolic-ref HEAD)
+ test "$branch" = "refs/heads/$1"
+}
+
p=example
mkdir $p.2
@@ -14,20 +19,25 @@ git init
t-dgit setup-new-tree
t-dgit checkout -p $p unstable
+now-on dgit/sid
t-refs-same-start
t-ref-head
t-ref-same refs/tags/test-dummy/$v
t-dgit checkout -p $p stable
+now-on dgit/stable
t-dgit checkout -d no-such-distro sid
t-ref-head
+now-on dgit/sid
t-dgit checkout stable
+now-on dgit/stable
git branch -D dgit/sid
t-dgit checkout -d no-such-distro sid
t-ref-head
+now-on dgit/sid
git reflog --pretty=tformat:%gs >../reflog.got
cat >../reflog.expect <<END