projects/guix·blob kernel-updates · refs

60 lines · 2.4 KiB

1Upstream-status: https://gitworkshop.dev/danconwaydev.com/ngit/issues/nevent1qy28wumn8ghj7un9d3shjtnwva5hgtnyv4mqqgyy4qx0pln24rlzq7jthk2s8p5v99yelt0k82nr90jtnzf28c0decntt55l
2From: Danny Milosavljevic <[email protected]>
3Date: Thu Sep 10 11:15:17 PM CEST 2026
4Subject: Use the linked libgit2 version in patch-generation test expectations.
5
6Guix links ngit against its packaged libgit2, which can be a different version
7than the version that had been bundled with libgit2-sys.
8Preserve the complete patch-content assertions while deriving the version
9footer from the library actually in use.
10
11--- a/src/lib/git/mod.rs
12+++ b/src/lib/git/mod.rs
13@@ -1742,9 +1742,10 @@
14 let oid = test_repo.populate()?;
15
16 let git_repo = Repo::from_path(&test_repo.dir)?;
17+ let (major, minor, patch) = git2::Version::get().libgit2_version();
18
19 assert_eq!(
20- "\
21+ format!("\
22 From 431b84edc0d2fa118d63faa3c2db9c73d630a5ae Mon Sep 17 00:00:00 2001\n\
23 From: Joe Bloggs <[email protected]>\n\
24 Date: Thu, 1 Jan 1970 00:00:00 +0000\n\
25@@ -1764,9 +1765,9 @@
26 +some content1\n\\ \
27 No newline at end of file\n\
28 --\n\
29- libgit2 1.9.2\n\
30+ libgit2 {major}.{minor}.{patch}\n\
31 \n\
32- ",
33+ "),
34 git_repo.make_patch_from_commit(&oid_to_sha1(&oid), &None)?,
35 );
36 Ok(())
37@@ -1778,9 +1779,10 @@
38 let oid = test_repo.populate()?;
39
40 let git_repo = Repo::from_path(&test_repo.dir)?;
41+ let (major, minor, patch) = git2::Version::get().libgit2_version();
42
43 assert_eq!(
44- "\
45+ format!("\
46 From 431b84edc0d2fa118d63faa3c2db9c73d630a5ae Mon Sep 17 00:00:00 2001\n\
47 From: Joe Bloggs <[email protected]>\n\
48 Date: Thu, 1 Jan 1970 00:00:00 +0000\n\
49@@ -1800,9 +1802,9 @@
50 +some content1\n\\ \
51 No newline at end of file\n\
52 --\n\
53- libgit2 1.9.2\n\
54+ libgit2 {major}.{minor}.{patch}\n\
55 \n\
56- ",
57+ "),
58 git_repo.make_patch_from_commit(&oid_to_sha1(&oid), &Some((3, 5)))?,
59 );
60 Ok(())