summaryrefslogtreecommitdiff
path: root/tests/tests/checkout
blob: 756c49bddc2b465f246b0b5d2b374f21634f7d6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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