Fix dotfiles branch resolution and disk space calculation#25
Merged
fullstackjam merged 4 commits intomainfrom Apr 19, 2026
Merged
Fix dotfiles branch resolution and disk space calculation#25fullstackjam merged 4 commits intomainfrom
fullstackjam merged 4 commits intomainfrom
Conversation
… gosec resolveBranch fell back to "main" whenever local origin/HEAD wasn't a symbolic ref (e.g. cloned from an empty bare), causing TestClone_DetachedHeadFallback and any user with a master-default repo to fail with "ambiguous argument 'origin/main'". Add a final fallback that consults the remote via `git ls-remote --symref origin HEAD`. Also annotate the syscall.Statfs block-size conversion in brew.CheckDiskSpace so `golangci-lint run` is clean on Linux too (stat.Bsize is int64 on linux, uint32 on darwin — value is always non-negative).
|
👋 Thanks for opening this pull request! Before merging:
@fullstackjam will review this soon. Thanks for contributing! 🚀 |
- golangci/golangci-lint-action@v6 only supports golangci-lint v1; with the recent bump to v2.11.4 it errors out at startup. Bump the action to v7, which is the v2-compatible release. - actions/labeler@v5 requires the new `changed-files` schema. The current config uses the v4 flat-glob form, so every PR fails labeling with "found unexpected type for label 'catalog'". Convert each entry to the v5 `changed-files: any-glob-to-any-file` form.
….11.4) golangci-lint v2.11.4 enforces a stricter schema than 2.5 and rejects the deprecated `run.exclude-dirs` key with "additional properties 'exclude-dirs' not allowed". Move the directory list to `linters.exclusions.paths` (the v2 location) and drop the now-redundant per-path testutil rule.
…lobals When npm is installed but `npm list -g --depth=0 --parseable` returns only the prefix line (or only npm/corepack), the loop never appends and `var packages []string` stays nil. TestCaptureNpm_NoPanic asserts the returned slice is not nil, so the test fails on macOS-CI runners where npm is present but has no user-installed globals. Initialise as an empty slice to match the early-return contract.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
What does this PR do?
Improves dotfiles branch detection by querying the remote when local origin/HEAD is not configured, and fixes a platform-specific type issue in disk space calculation.
Why?
Dotfiles branch resolution: When
origin/HEADis not configured locally (common in shallow clones or certain git configurations), the branch detection would fail and fall back to "main". This change queries the remote to discover its default branch, making the resolution more robust.Disk space calculation:
stat.Bsizehas different types on different platforms (uint32 on darwin, int64 on linux), which can trigger linter warnings. Added an explicit comment and linter suppression to document that the conversion is safe since the kernel always reports non-negative block sizes.Testing
go vet ./...passesNotes for reviewer
The disk space change is purely a linter suppression with documentation—no functional change. The dotfiles branch resolution adds a fallback mechanism that only activates when the initial resolution fails, so it's backward compatible.
https://claude.ai/code/session_01XmME3PjsGexbNyW58ebTJp