@matheusbsbs / matheus-bagliano / commits / 5aa6877540
Fork 0

t9168: make test hash independent

Instead of stripping off the first 41 characters of git log output, let's just strip off the first space-separated component, which will work for any size hash. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Acked-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Jun 19, 2020 at 22:39 UTC 5aa68775408646753534dee69004745802487877
1 file changed +4 -4
t/t9168-git-svn-partially-globbed-names.sh
+4 -4
@@ -49,7 +49,7 @@ test_expect_success 'test refspec prefixed globbing' '
49 "tags/t_*/src/a:refs/remotes/tags/t_*" &&
50 git svn multi-fetch &&
51 git log --pretty=oneline refs/remotes/tags/t_end >actual &&
52 - sed -e "s/^.\{41\}//" actual >output.end &&
52 + cut -d" " -f2- actual >output.end &&
53 test_cmp expect.end output.end &&
54 test "$(git rev-parse refs/remotes/tags/t_end~1)" = \
55 "$(git rev-parse refs/remotes/branches/b_start)" &&
@@ -87,7 +87,7 @@ test_expect_success 'test left-hand-side only prefixed globbing' '
87 test $(git rev-parse refs/remotes/two/tags/t_end~3) = \
88 $(git rev-parse refs/remotes/two/branches/b_start) &&
89 git log --pretty=oneline refs/remotes/two/tags/t_end >actual &&
90 - sed -e "s/^.\{41\}//" actual >output.two &&
90 + cut -d" " -f2- actual >output.two &&
91 test_cmp expect.two output.two
92 '
93
@@ -129,7 +129,7 @@ test_expect_success 'test prefixed globs match just prefix' '
129 test $(git rev-parse refs/remotes/three/tags/t_~1) = \
130 $(git rev-parse refs/remotes/three/branches/b_) &&
131 git log --pretty=oneline refs/remotes/three/tags/t_ >actual &&
132 - sed -e "s/^.\{41\}//" actual >output.three &&
132 + cut -d" " -f2- actual >output.three &&
133 test_cmp expect.three output.three
134 '
135
@@ -199,7 +199,7 @@ test_expect_success 'test globbing in the middle of the word' '
199 test $(git rev-parse refs/remotes/five/tags/fghij~1) = \
200 $(git rev-parse refs/remotes/five/branches/abcde) &&
201 git log --pretty=oneline refs/remotes/five/tags/fghij >actual &&
202 - sed -e "s/^.\{41\}//" actual >output.five &&
202 + cut -d" " -f2- actual >output.five &&
203 test_cmp expect.five output.five
204 '
205