Skip to content

Specify initial_head when initializing a repository for tests so the global git config doesn't make it fail #988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

lapfelix
Copy link
Contributor

My global git config includes init.defaultbranch set to develop so 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's initial_head option) so the computer's global git config is ignored.

I AGREE TO THE GITUP CONTRIBUTOR LICENSE AGREEMENT

@lucasderraugh lucasderraugh merged commit aabbc8a into git-up:master Apr 23, 2024
@storagesiddiq
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants