Why Nostr? What is Njump?
2024-07-01 08:14:10

nostr-commits on Nostr: ngit-cli : test: fix test affected by user config applies: ...

ngit-cli : test: fix test affected by user config

applies:
From b98fe272fc98db8d0205558b8b20c350da200edd Mon Sep 17 00:00:00 2001
Subject: [PATCH 0/1] Fix tests affected by user config

As I discussed a few months ago, a couple of tests were failing due to them being affected by my user-level git configuration. We've tried the way of setting the GIT_CONFIG_HOME=/dev/null environment variables through cargo, but it did not work very well as it needs to be added to the user-level cargo/config.toml (not project-level). I then figured that the easiest way to fix this was to set the problematic diff.mnemonicPrefix config option to false using the propper git2 API for the testing repos. It worked!

closes
From b4ce7259a46ac6f464a101b77c0f312b970d8f6e Mon Sep 17 00:00:00 2001
From: DanConwayDev
Date: Fri, 3 May 2024 16:39:40 +0100
Subject: [PATCH] build: ignore git config in cargo

so that tests are not affected by settings.

sommerfield had a custom patch setting in their config which make some tests fail
---
config.toml | 4 +++-
test_utils/config.toml | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/config.toml b/config.toml
index 519f44f..63b23d5 100644
--- a/config.toml
+++ b/config.toml
@@ -1,2 +1,4 @@
[env]
-NGITTEST = true
\ No newline at end of file
+NGITTEST = true
+HOME =
+XDG_CONFIG_HOME =
\ No newline at end of file
diff --git a/test_utils/config.toml b/test_utils/config.toml
index 519f44f..63b23d5 100644
--- a/test_utils/config.toml
+++ b/test_utils/config.toml
@@ -1,2 +1,4 @@
[env]
-NGITTEST = true
\ No newline at end of file
+NGITTEST = true
+HOME =
+XDG_CONFIG_HOME =
\ No newline at end of file
--
libgit2 1.7.2

https://github.com/DanConwayDev/ngit-cli/commit/cc1cc62d8bd79920249f0738c20d5546f5363f28
Author Public Key
npub1qqqqqhu87ep5rssjejfadsnxcqaww5kqyesw0znd59py77c9c3cqfec28r