summaryrefslogtreecommitdiff
path: root/user/libgit2/test-fix.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-05-29 18:22:45 -0500
committerZach van Rijn <me@zv.io>2022-06-12 23:51:54 +0000
commit15d90386e5c58cf1f0081644076eb22ac7751f4e (patch)
tree375a4602eea2bbf0592482820e849749b7882f81 /user/libgit2/test-fix.patch
parent868dd3fb36844385ef6b6bd6abfecc3114817390 (diff)
downloadpackages-15d90386e5c58cf1f0081644076eb22ac7751f4e.tar.gz
packages-15d90386e5c58cf1f0081644076eb22ac7751f4e.tar.bz2
packages-15d90386e5c58cf1f0081644076eb22ac7751f4e.tar.xz
packages-15d90386e5c58cf1f0081644076eb22ac7751f4e.zip
user/libgit2: Fix tests properly
The 'offline' suite was failing the revparse test due to an unexpected passage of time. (Upstream's words, not mine.) Backport the fix for this test from v1.4 to our release. Fixes: #686
Diffstat (limited to 'user/libgit2/test-fix.patch')
-rw-r--r--user/libgit2/test-fix.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/user/libgit2/test-fix.patch b/user/libgit2/test-fix.patch
new file mode 100644
index 000000000..a6eed991a
--- /dev/null
+++ b/user/libgit2/test-fix.patch
@@ -0,0 +1,27 @@
+From bdab22384cc61d315005a65456a9f9563bb27c8f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= <carlosmn@github.com>
+Date: Tue, 3 May 2022 09:28:43 +0200
+Subject: [PATCH] revparse: adjust reflog test as we move away from the dates
+
+The dates we use in `refs::revparse::date` has just passed the ten years, so
+now everything is beyond ten years, leading to an unexpected commit being
+returned.
+
+Adjust it to 11 years so it all looks fine again.
+---
+ tests/libgit2/refs/revparse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/libgit2/refs/revparse.c b/tests/libgit2/refs/revparse.c
+index 0bd2ae5bc2c..93d7ce6db81 100644
+--- a/tests/refs/revparse.c
++++ b/tests/refs/revparse.c
+@@ -400,7 +400,7 @@ void test_refs_revparse__date(void)
+ * a65fedf HEAD@{1335806603 -0900}: commit:
+ * be3563a HEAD@{1335806563 -0700}: clone: from /Users/ben/src/libgit2/tests/resour
+ */
+- test_object("HEAD@{10 years ago}", NULL);
++ test_object("HEAD@{11 years ago}", NULL);
+
+ test_object("HEAD@{1 second}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ test_object("HEAD@{1 second ago}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");