summaryrefslogtreecommitdiff
path: root/tests/tests/checkout
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2018-07-12 08:33:17 +0100
committerSean Whitton <spwhitton@spwhitton.name>2018-07-12 08:33:17 +0100
commitae8f33be945323e02e670a97c8ac6d42a0e1be40 (patch)
tree2bbf98c464b32b8ede618bf93929741246b81b5f /tests/tests/checkout
parent4a142fe137c1bed5a0cb5d14c41adcb3355458c4 (diff)
parent7166dbc963a9c01ce62a0564bb7b905156adb560 (diff)
Merge tag 'debian/5.8' into stretch-bpo
dgit release 5.8 for unstable (sid) [dgit] [dgit distro=debian] # gpg: Signature made Sun 08 Jul 2018 11:43:29 BST # gpg: using RSA key 559AE46C2D6B6D3265E7CBA1E3E3392348B50D39 # gpg: Can't check signature: No public key
Diffstat (limited to 'tests/tests/checkout')
-rwxr-xr-xtests/tests/checkout59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/tests/checkout b/tests/tests/checkout
new file mode 100755
index 0000000..756c49b
--- /dev/null
+++ b/tests/tests/checkout
@@ -0,0 +1,59 @@
+#!/bin/bash
+set -e
+. tests/lib
+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
+cd $p.2
+
+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
+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 | t-sort >../refs.got
+cat >../refs.expect <<END
+refs/heads/dgit/sid
+refs/heads/dgit/stable
+END
+diff -u ../refs.{expect,got}
+
+t-ok