summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-04 01:54:13 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-04 01:59:22 +0100
commit950f90c24d818782a88c612cb24845b8086a281f (patch)
tree7bcb685d4910ea1214ae9c6fde3c81da224d8006 /tests/tests
parenteb41bc5fcd22bfe48820ef82bc2ce0c0f7131bc1 (diff)
test suite: checkout: new test
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/tests')
-rwxr-xr-xtests/tests/checkout49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/tests/checkout b/tests/tests/checkout
new file mode 100755
index 0000000..4b205f3
--- /dev/null
+++ b/tests/tests/checkout
@@ -0,0 +1,49 @@
+#!/bin/bash
+set -e
+. tests/lib
+t-tstunt-parsechangelog
+
+t-setup-import examplegit
+
+p=example
+
+mkdir $p.2
+cd $p.2
+
+git init
+t-dgit setup-new-tree
+t-dgit checkout -p $p unstable
+
+t-refs-same-start
+t-ref-head
+t-ref-same refs/tags/test-dummy/$v
+
+t-dgit checkout -p $p stable
+
+t-dgit checkout -d no-such-distro sid
+t-ref-head
+
+t-dgit checkout stable
+
+git branch -D dgit/sid
+t-dgit checkout -d no-such-distro sid
+t-ref-head
+
+git reflog --pretty=tformat:%gs >../reflog.got
+cat >../reflog.expect <<END
+dgit checkout sid
+dgit checkout stable
+dgit checkout sid
+dgit checkout stable
+dgit checkout unstable
+END
+diff -u ../reflog.{expect,got}
+
+git for-each-ref --format='%(refname)' refs/heads | sort >../refs.got
+cat >../refs.expect <<END
+refs/heads/dgit/sid
+refs/heads/dgit/stable
+END
+diff -u ../refs.{expect,got}
+
+t-ok