Skip to content
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

[LibGit2] Teach tests to be resilient to init.defaultBranch #44629

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

staticfloat
Copy link
Member

If a user runs the tests with a ~/.gitconfig that provides an
init.defaultBranch that is not master, our tests fail. Let's adjust
to the user's configuration as appropriate.

@KristofferC KristofferC added libgit2 The libgit2 library or the LibGit2 stdlib module backport 1.8 Change should be backported to release-1.8 labels Mar 15, 2022
If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.
@staticfloat staticfloat force-pushed the sf/libgit2_main_resillience branch from 0fd0602 to 3f19cc3 Compare March 15, 2022 18:44
@giordano giordano linked an issue Mar 15, 2022 that may be closed by this pull request
@DilumAluthge DilumAluthge added the merge me PR is reviewed. Merge when all tests are passing label Mar 15, 2022
@DilumAluthge DilumAluthge merged commit ac1d693 into master Mar 16, 2022
@DilumAluthge DilumAluthge deleted the sf/libgit2_main_resillience branch March 16, 2022 00:53
@DilumAluthge
Copy link
Member

@staticfloat Does this need backport to 1.6 and 1.7 as well? Or just 1.8?

@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Mar 16, 2022
KristofferC pushed a commit that referenced this pull request Mar 16, 2022
If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)
KristofferC pushed a commit that referenced this pull request Mar 16, 2022
If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)
@staticfloat
Copy link
Member Author

Yeah, it wouldn't hurt

@DilumAluthge DilumAluthge added backport 1.6 Change should be backported to release-1.6 backport 1.7 labels Mar 16, 2022
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Mar 21, 2022
KristofferC pushed a commit that referenced this pull request Mar 25, 2022
If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)
KristofferC added a commit that referenced this pull request Mar 26, 2022
#44745)

If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)

Co-authored-by: Elliot Saba <staticfloat@gmail.com>
staticfloat added a commit to JuliaLang/Pkg.jl that referenced this pull request Mar 31, 2022
In the same vein as JuliaLang/julia#44629, we
need `Pkg` to look up the default branch for `git init` and use that
name when performing git-based tests on a user's machine.
KristofferC pushed a commit that referenced this pull request Apr 19, 2022
If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)
@KristofferC KristofferC mentioned this pull request Apr 19, 2022
40 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jul 6, 2022
KristofferC added a commit that referenced this pull request Dec 21, 2022
#44745)

If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)

Co-authored-by: Elliot Saba <staticfloat@gmail.com>
staticfloat added a commit that referenced this pull request Dec 23, 2022
#44745)

If a user runs the tests with a `~/.gitconfig` that provides an
`init.defaultBranch` that is not `master`, our tests fail.  Let's adjust
to the user's configuration as appropriate.  We'll also rename this to
`default_branch` to signify that it may not be called `master` anymore.

(cherry picked from commit ac1d693)

Co-authored-by: Elliot Saba <staticfloat@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI failures due to main vs master branches in LibGit2 tests on macOS
5 participants