summaryrefslogtreecommitdiffstats
path: root/test/blame/stash-test
blob: 4e9b059c8206f1e0bd1425f1bbea745a5d1740d5 (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
#!/bin/sh

. libtest.sh
. libgit.sh

tigrc <<EOF
set blame-view = text
EOF

steps '
	:view-stash
	:view-diff
	:move-last-line
	:move-up
	:save-display diff.screen
	:view-blame
	:save-display blame1.screen
	:view-close
	:view-blame
	:save-display blame2.screen
'

git_init

test_setup_work_dir()
{
	echo "original line" > file
	git add file
	git commit -m "Initial commit"
	echo "changed line" > file
	git stash
}

LINES=3 test_tig

assert_equals 'diff.screen' <<EOF
-original line
[diff] Changes to 'file' - line 9 of 10  90%
EOF

assert_equals 'blame1.screen' <<EOF
original line
[blame] file - line 1 of 1 100%
EOF

assert_equals 'blame2.screen' <<EOF
original line
[blame] file - line 1 of 1 100%
EOF