-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for refresh-mode = periodic (issue #430). #591
Changes from all commits
fed1bd1
0b44005
62039ed
a1be02c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
#!/bin/sh | ||
|
||
. libtest.sh | ||
. libgit.sh | ||
. "$source_dir/util.sh" | ||
|
||
export LINES=5 | ||
|
||
steps ' | ||
:save-display main-with-unstaged.screen | ||
|
||
:exec @git add a | ||
:save-display main-after-add-a.screen | ||
|
||
:exec @git commit -m "Commit changes" | ||
:save-display main-after-commit.screen | ||
|
||
:exec @git add b.c | ||
:exec @git commit -m "Another change: hello" | ||
:exec @sleep 2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need an advice about test/main/refresh-periodic-test: as it is, I am not sure that it correctly checks that the automatic refresh works. Sleeping for several seconds through exec, seems to block the whole program, which is not the same as tig being idle for this time. Is there a better way to ensure that tig will just simply sit idle for a while? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will require some rework. I'll take a look. |
||
:save-display main-after-commiting-change-and-sleeping-hello.screen | ||
|
||
:exec @git add i.o | ||
:exec @git commit -am "Another change: world" | ||
:exec @sleep 2 | ||
:save-display main-after-commiting-change-and-sleeping-world.screen | ||
' | ||
|
||
tigrc <<EOF | ||
set refresh-mode = periodic | ||
set refresh-interval = 1 | ||
EOF | ||
|
||
in_work_dir create_dirty_workdir | ||
|
||
export GIT_AUTHOR_DATE="$(expr $author_date + $author_date_delta)" | ||
export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" | ||
|
||
test_tig | ||
|
||
assert_equals 'main-with-unstaged.screen' <<EOF | ||
$YYY_MM_DD_HH_MM Unknown o Unstaged changes | ||
2009-02-13 23:31 A. U. Thor I [master] Initial commit | ||
|
||
[main] Unstaged changes 100% | ||
EOF | ||
|
||
assert_equals 'main-after-add-a.screen' <<EOF | ||
$YYY_MM_DD_HH_MM Unknown o Unstaged changes | ||
$YYY_MM_DD_HH_MM Unknown o Staged changes | ||
2009-02-13 23:31 A. U. Thor I [master] Initial commit | ||
[main] Unstaged changes 100% | ||
EOF | ||
|
||
assert_equals 'main-after-commit.screen' <<EOF | ||
2014-05-25 19:42 Unknown o Unstaged changes | ||
2009-02-22 11:53 Committer o [master] Commit changes | ||
2009-02-13 23:31 A. U. Thor I Initial commit | ||
[main] Unstaged changes 100% | ||
EOF | ||
|
||
assert_equals 'main-after-commiting-change-and-sleeping-hello.screen' <<EOF | ||
2014-05-25 19:42 Unknown o Unstaged changes | ||
2009-02-22 11:53 Committer o [master] Another change: hello | ||
2009-02-22 11:53 Committer o Commit changes | ||
[main] Unstaged changes 75% | ||
EOF | ||
|
||
assert_equals 'main-after-commiting-change-and-sleeping-world.screen' <<EOF | ||
2009-02-22 11:53 Committer o [master] Another change: world | ||
2009-02-22 11:53 Committer o Another change: hello | ||
2009-02-22 11:53 Committer o Commit changes | ||
[main] 70bab5b220d2fd9bf61c125d52d59e10e93ec341 - commit 1 of 4 75% | ||
EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch.