summaryrefslogtreecommitdiff
path: root/contrib/diff-highlight
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2018-03-21 01:48:40 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-21 10:24:19 -0700
commit53ab9f0e3d0ff2bb5803059da3526ef6eda8ce65 (patch)
tree9275a87f1a58c74b5508f6c018c246230a01fd82 /contrib/diff-highlight
parentdiff-highlight: correct test graph diagram (diff)
downloadtgif-53ab9f0e3d0ff2bb5803059da3526ef6eda8ce65.tar.xz
diff-highlight: use test_tick in graph test
The exact ordering output by Git may depend on the commit timestamps, so let's make sure they're actually monotonically increasing, and not all the same (or worse, subject to how long the test script takes to run). Let's use test_tick to make sure this is stable. Note that we actually have to rearrange the order of the branches to match the expected graph structure (which means that previously we might racily have been testing a slightly different output, though the test is written in such a way that we'd still pass). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/diff-highlight')
-rwxr-xr-xcontrib/diff-highlight/t/t9400-diff-highlight.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/contrib/diff-highlight/t/t9400-diff-highlight.sh b/contrib/diff-highlight/t/t9400-diff-highlight.sh
index bf62f036c7..deab90ed91 100755
--- a/contrib/diff-highlight/t/t9400-diff-highlight.sh
+++ b/contrib/diff-highlight/t/t9400-diff-highlight.sh
@@ -52,9 +52,9 @@ test_strip_patch_header () {
# dh_test_setup_history generates a contrived graph such that we have at least
# 1 nesting (E) and 2 nestings (F).
#
-# A branch
+# A master
# /
-# D---E---F master
+# D---E---F branch
#
# git log --all --graph
# * commit
@@ -74,18 +74,22 @@ dh_test_setup_history () {
cat file1 >file &&
git add file &&
+ test_tick &&
git commit -m "D" &&
git checkout -b branch &&
cat file2 >file &&
- git commit -a -m "A" &&
-
- git checkout master &&
- cat file2 >file &&
+ test_tick &&
git commit -a -m "E" &&
cat file3 >file &&
- git commit -a -m "F"
+ test_tick &&
+ git commit -a -m "F" &&
+
+ git checkout master &&
+ cat file2 >file &&
+ test_tick &&
+ git commit -a -m "A"
}
left_trim () {