#!/bin/sh

. libtest.sh
. libgit.sh

export LINES=18

tigrc <<EOF
set line-graphics = ascii
set refresh-mode = manual
EOF

steps '
	:/mp/feature

	:1
	:exec !assert-var "%(branch)" == "mp/feature"

	:2
	:exec !assert-var "%(branch)" == "master"

	:14
	:exec !assert-var "%(branch)" == "r1.1.2"

	:15
	:exec !assert-var "%(branch)" == "r1.0"

	:1
	:save-display main.screen
'

in_work_dir create_repo_from_tgz "$base_dir/files/refs-repo.tgz"

test_tig --all

assert_vars 4

assert_equals 'main.screen' <<EOF
2009-02-13 23:31 +0000 Max Power             * [mp/feature] {max-power/mp/featur
2010-04-07 05:37 +0000 Max Power             * [master] {origin/master} {max-pow
2010-03-29 17:15 +0000 Jørgen Thygesen Brahe * Commit 10 D
2010-03-21 04:53 +0000 作者                  * Commit 10 C
2010-03-12 16:31 +0000 René Lévesque         * <v2.0.1> Commit 10 B
2010-03-04 04:09 +0000 A. U. Thor            * <v2.0> Commit 10 A
2010-02-23 15:46 +0000 Max Power             * Commit 9 E
2010-02-15 03:24 +0000 Jørgen Thygesen Brahe * Commit 9 D
2010-02-06 15:02 +0000 作者                  * Commit 9 C
2010-01-29 02:40 +0000 René Lévesque         * Commit 9 B
2010-01-20 14:18 +0000 A. U. Thor            * <v1.1.1> Commit 9 A
2010-01-12 01:56 +0000 Max Power             * <mp/good> Commit 8 E
2010-01-03 13:33 +0000 Jørgen Thygesen Brahe * Commit 8 D
2009-12-26 01:11 +0000 作者                  * [r1.1.2] [r1.1.x] <v1.1> Commit 8
2009-12-17 12:49 +0000 René Lévesque         * [r1.0] <v1.0> Commit 8 B
2009-12-09 00:27 +0000 A. U. Thor            * Commit 8 A
[main] 042f71a7592228ae84cbb3642c2666dcd35aa527 - commit 1 of 51             31%
EOF
