#!/bin/sh

. libtest.sh
. libgit.sh

test_setup_work_dir()
{
	create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz"
	file .git/logs/refs/stash <<EOF
EOF
	for i in $(seq 1 10); do
		printf '%s\n' "$i" > "stashed-file-$i"
		git stash save -q -u "Stash #$i"
	done
}

steps '
	:save-display position.screen
'

tigrc <<EOF
set stash-view	= line-number:no,interval=5 id:no author:full commit-title
EOF

test_tig stash +42

assert_equals 'position.screen' <<EOF
Committer On master: Stash #10
Committer On master: Stash #9
Committer On master: Stash #8
Committer On master: Stash #7
Committer On master: Stash #6
Committer On master: Stash #5
Committer On master: Stash #4
Committer On master: Stash #3
Committer On master: Stash #2
Committer On master: Stash #1


















[stash] stash@{9} - stash 10 of 10                                          100%
EOF
