[PR #621] [MERGED] tests: keep merge_check independent of the user's git ignore file (TEST-MERGE-CHECK-XDG-IGNORE) #662

Closed
opened 2026-11-26 20:18:37 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/621
Author: @DesertGamer
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism

Base: main ← Head: fix/merge-check-xdg-ignore


📝 Commits (1)

  • 283c881 tests: keep merge_check independent of the user's git ignore file

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 tests/test_merge_check.py (+1 -1)

📄 Description

Claimed in the coordination issue as: TEST-MERGE-CHECK-XDG-IGNORE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128205566)

What and why

tests/test_merge_check.py isolates git from the user's configuration with GIT_CONFIG_GLOBAL=nul and
GIT_CONFIG_NOSYSTEM=1, but git still reads its default global ignore file, $XDG_CONFIG_HOME/git/ignore
(~/.config/git/ignore when the variable is unset), because core.excludesFile falls back to it without any
config. On a machine whose global ignore file lists docs/, setUp stages docs/notes.md, git skips it, the first
commit fails with "nothing to commit" and all 20 tests fail in setUp.

The test now also sets XDG_CONFIG_HOME to its temporary repository folder, which has no git/ignore, so the
result no longer depends on the user's ignore rules.

Tested

  • python -I tests/test_merge_check.py with docs/ in ~/.config/git/ignore: 20 failures before, Ran 20 tests ... OK after.
  • Reproduced the cause outside the test: in a fresh repository with the same environment, git add -A of
    docs/notes.md followed by git commit printed "nothing to commit".
  • Windows 11 Pro 10.0.26200, Python 3.14.6, git for Windows.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/621 **Author:** [@DesertGamer](https://github.com/DesertGamer) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@ubiquitarianism](https://github.com/ubiquitarianism) **Base:** `main` ← **Head:** `fix/merge-check-xdg-ignore` --- ### 📝 Commits (1) - [`283c881`](https://github.com/ubiquitarianism/leonida/commit/283c8818b4101dd2c4cfa4d67aa8265826984eff) tests: keep merge_check independent of the user's git ignore file ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_merge_check.py` (+1 -1) </details> ### 📄 Description Claimed in the coordination issue as: TEST-MERGE-CHECK-XDG-IGNORE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7128205566) ### What and why `tests/test_merge_check.py` isolates git from the user's configuration with `GIT_CONFIG_GLOBAL=nul` and `GIT_CONFIG_NOSYSTEM=1`, but git still reads its default global ignore file, `$XDG_CONFIG_HOME/git/ignore` (`~/.config/git/ignore` when the variable is unset), because `core.excludesFile` falls back to it without any config. On a machine whose global ignore file lists `docs/`, `setUp` stages `docs/notes.md`, git skips it, the first commit fails with "nothing to commit" and all 20 tests fail in `setUp`. The test now also sets `XDG_CONFIG_HOME` to its temporary repository folder, which has no `git/ignore`, so the result no longer depends on the user's ignore rules. ### Tested - `python -I tests/test_merge_check.py` with `docs/` in `~/.config/git/ignore`: 20 failures before, `Ran 20 tests ... OK` after. - Reproduced the cause outside the test: in a fresh repository with the same environment, `git add -A` of `docs/notes.md` followed by `git commit` printed "nothing to commit". - Windows 11 Pro 10.0.26200, Python 3.14.6, git for Windows. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:37 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#662
No description provided.