Skip to content

Commit 5aa6877

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Acked-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 62814df commit 5aa6877

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t9168-git-svn-partially-globbed-names.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_expect_success 'test refspec prefixed globbing' '
4949
"tags/t_*/src/a:refs/remotes/tags/t_*" &&
5050
git svn multi-fetch &&
5151
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 &&
5353
test_cmp expect.end output.end &&
5454
test "$(git rev-parse refs/remotes/tags/t_end~1)" = \
5555
"$(git rev-parse refs/remotes/branches/b_start)" &&
@@ -87,7 +87,7 @@ test_expect_success 'test left-hand-side only prefixed globbing' '
8787
test $(git rev-parse refs/remotes/two/tags/t_end~3) = \
8888
$(git rev-parse refs/remotes/two/branches/b_start) &&
8989
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 &&
9191
test_cmp expect.two output.two
9292
'
9393

@@ -129,7 +129,7 @@ test_expect_success 'test prefixed globs match just prefix' '
129129
test $(git rev-parse refs/remotes/three/tags/t_~1) = \
130130
$(git rev-parse refs/remotes/three/branches/b_) &&
131131
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 &&
133133
test_cmp expect.three output.three
134134
'
135135

@@ -199,7 +199,7 @@ test_expect_success 'test globbing in the middle of the word' '
199199
test $(git rev-parse refs/remotes/five/tags/fghij~1) = \
200200
$(git rev-parse refs/remotes/five/branches/abcde) &&
201201
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 &&
203203
test_cmp expect.five output.five
204204
'
205205

0 commit comments

Comments
 (0)