Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-11 00:55:43 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-11 01:24:13 +0300
commita5cdca452052e824c9f3f7cf78385fbec5bb1976 (patch)
tree9bf24ae7ec5a100882ff80ac2639b822f783dbc6 /t/t1500-rev-parse.sh
parent773e25afc41b1b6533fa9ae2cd825d0b4a697fad (diff)
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 <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1500-rev-parse.sh')
-rwxr-xr-xt/t1500-rev-parse.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 408b97d5af..56549efc96 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -185,4 +185,19 @@ test_expect_success 'showing the superproject correctly' '
test_cmp expect out
'
+# at least one external project depends on this behavior:
+test_expect_success 'rev-parse --since= unsqueezed ordering' '
+ x1=--since=1970-01-01T00:00:01Z &&
+ x2=--since=1970-01-01T00:00:02Z &&
+ x3=--since=1970-01-01T00:00:03Z &&
+ git rev-parse $x1 $x1 $x3 $x2 >actual &&
+ cat >expect <<-EOF &&
+ --max-age=1
+ --max-age=1
+ --max-age=3
+ --max-age=2
+ EOF
+ test_cmp expect actual
+'
+
test_done