Specify initial_head when initializing a repository for tests so the global git config doesn't make it fail#988
Merged
Conversation
…e global git config doesn't make it fail
lucasderraugh
approved these changes
Apr 23, 2024
|
Thank you for your query |
Cykelero
added a commit
to Cykelero/GitUp
that referenced
this pull request
Mar 31, 2025
These tests failed if you'd set the default branch name to e.g. main in your global Git config. This builds on “Specify `initial_head` when initializing a repository for tests so the global git config doesn't make it fail (git-up#988)” (aabbc8a).
lucasderraugh
pushed a commit
that referenced
this pull request
May 20, 2025
* libgit2: bump submodule to updated fork * libgit2: Remove tutorial comments from Package.swift * libgit2 : use llhttp instead of http-client dependency libgit2 changed which one it embeds. * libgit2: update build excludes, build options - Update source excludes (mostly, libgit2 source files were moved into new `libgit2, `util` and `cli` subfolders) - Update compiler options to reflect changes in libgit2's CMake config * libgit2: Use OpenSSH provider This replaces the libssh2 SSH backend, and enables support of .ssh/config. * libgit2: Silence most warnings We're not interested in these when working on GitUp itself. * libgit2: Hide incomplete deprecation warnings These warnings are emitted *after* the actual libgit2 build, so these compiler options need to be in the project build settings, rather than the Third-Party package build settings. This commit only adds -Wno-documentation-deprecated-sync to the each list; previously, we were using the default values, which are now explicit. * Tests: Fix empty live repo tests by setting default branch name These tests failed if you'd set the default branch name to e.g. main in your global Git config. This builds on “Specify `initial_head` when initializing a repository for tests so the global git config doesn't make it fail (#988)” (aabbc8a). * Add .editorconfig * Don't crash when libgit2 writes to a closed pipe This seems to happen whenever we pull from a remote with changes.
Cykelero
added a commit
to Cykelero/GitUp
that referenced
this pull request
Dec 16, 2025
These tests failed if you'd set the default branch name to e.g. main in your global Git config. This builds on “Specify `initial_head` when initializing a repository for tests so the global git config doesn't make it fail (git-up#988)” (aabbc8a).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My global git config includes
init.defaultbranchset todevelopso two thirds of the tests would fail on my computer. This change makes the tests work on more computers by explicitly specifying "master" as the default branch name (through libgit2'sinitial_headoption) so the computer's global git config is ignored.I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT