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

fix(unit): resolve TestRepository host git configuration dependency #3573

Merged
merged 3 commits into from
Mar 14, 2025

Conversation

brandtkeller
Copy link
Contributor

Description

Current test logic is coupled with the hosts ~/.gitconfig. If the host has

[init]
        defaultBranch = main

Then the TestRepository unit test at src/internal/git/repository_test.go will fail.

Undetermined how to decouple this fully within go-git as of yet. Issues are unclear and mixed results as far as consuming $HOME/.gitconfig are concerned and all explicit definition of main for defaultBranch still results in the HEAD containing the hosts default branch and not the configuration.

This change re-writes the HEAD file to match the explicit InitOptions such that it will now pass when the hosts .gitconfig does not align to the original workflow.

Related Issue

Fixes #3567

Checklist before merging

@brandtkeller brandtkeller self-assigned this Mar 13, 2025
Copy link

codecov bot commented Mar 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

netlify bot commented Mar 14, 2025

Deploy Preview for zarf-docs ready!

Name Link
🔨 Latest commit 4bd86e1
🔍 Latest deploy log https://app.netlify.com/sites/zarf-docs/deploys/67d44905f6754a00084610cf
😎 Deploy Preview https://deploy-preview-3573--zarf-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@brandtkeller brandtkeller force-pushed the 3567_repository_test branch from 7dd384f to 3658eac Compare March 14, 2025 00:06
@brandtkeller brandtkeller force-pushed the 3567_repository_test branch from 17a4157 to 4df0602 Compare March 14, 2025 00:08
@brandtkeller brandtkeller marked this pull request as ready for review March 14, 2025 02:03
@brandtkeller brandtkeller requested review from a team as code owners March 14, 2025 02:03
Copy link
Contributor

@mkcp mkcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brandtkeller brandtkeller added this pull request to the merge queue Mar 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 14, 2025
@brandtkeller brandtkeller added this pull request to the merge queue Mar 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 14, 2025
@brandtkeller brandtkeller added this pull request to the merge queue Mar 14, 2025
Merged via the queue into main with commit 5ebd1bc Mar 14, 2025
26 checks passed
@brandtkeller brandtkeller deleted the 3567_repository_test branch March 14, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consistent failures in the TestRespository unit test
2 participants