Skip to content

Commit a5cdca4

Browse files
Eric Wonggitster
authored andcommitted
t1500: ensure current --since= behavior remains
This behavior of git-rev-parse is observed since git 1.8.3.1 at least(*), and likely earlier versions. At least one git-reliant project in-the-wild relies on this current behavior of git-rev-parse being able to handle multiple --since= arguments without squeezing identical results together. So add a test to prevent the potential for regression in downstream projects. (*) 1.8.3.1 the version packaged for CentOS 7.x Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 773e25a commit a5cdca4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/t1500-rev-parse.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,19 @@ test_expect_success 'showing the superproject correctly' '
185185
test_cmp expect out
186186
'
187187

188+
# at least one external project depends on this behavior:
189+
test_expect_success 'rev-parse --since= unsqueezed ordering' '
190+
x1=--since=1970-01-01T00:00:01Z &&
191+
x2=--since=1970-01-01T00:00:02Z &&
192+
x3=--since=1970-01-01T00:00:03Z &&
193+
git rev-parse $x1 $x1 $x3 $x2 >actual &&
194+
cat >expect <<-EOF &&
195+
--max-age=1
196+
--max-age=1
197+
--max-age=3
198+
--max-age=2
199+
EOF
200+
test_cmp expect actual
201+
'
202+
188203
test_done

0 commit comments

Comments
 (0)