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>

Jeff King committed Mar 21, 2018 at 01:48 UTC 53ab9f0e3d0ff2bb5803059da3526ef6eda8ce65
1 file changed +11 -7
contrib/diff-highlight/t/t9400-diff-highlight.sh
+11 -7
@@ -52,9 +52,9 @@ test_strip_patch_header () {
52 # dh_test_setup_history generates a contrived graph such that we have at least
53 # 1 nesting (E) and 2 nestings (F).
54 #
55 -# A branch
55 +# A master
56 # /
57 -# D---E---F master
57 +# D---E---F branch
58 #
59 # git log --all --graph
60 # * commit
@@ -74,18 +74,22 @@ dh_test_setup_history () {
74
75 cat file1 >file &&
76 git add file &&
77 + test_tick &&
78 git commit -m "D" &&
79
80 git checkout -b branch &&
81 cat file2 >file &&
81 - git commit -a -m "A" &&
82 -
83 - git checkout master &&
84 - cat file2 >file &&
82 + test_tick &&
83 git commit -a -m "E" &&
84
85 cat file3 >file &&
88 - git commit -a -m "F"
86 + test_tick &&
87 + git commit -a -m "F" &&
88 +
89 + git checkout master &&
90 + cat file2 >file &&
91 + test_tick &&
92 + git commit -a -m "A"
93 }
94
95 left_trim () {