Skip to content

bump go-git to v6#759

Merged
aviator-app[bot] merged 1 commit into
masterfrom
bump-go-git-v6
Jun 18, 2026
Merged

bump go-git to v6#759
aviator-app[bot] merged 1 commit into
masterfrom
bump-go-git-v6

Conversation

@tulioz

@tulioz tulioz commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

trying go-git v6 while it's still in alpha

@aviator-app

aviator-app Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator (commit 3fd7a2d).


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the go-git dependency from v5 to v6 across the codebase, updating imports and dependencies in go.mod and go.sum. To comply with go-git v6's resource management requirements, a Close method was added to the Repo struct, and a closeRepo helper was introduced and deferred in main.go via a new run function wrapper. Additionally, several fields in the sequencer were refactored from plumbing.Hash to string. The review feedback recommends resetting cachedRepo to nil after closing it to prevent failures in multi-command execution environments, and adding defensive nil checks in Repo.Close to avoid potential nil-pointer dereferences.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cmd/av/helpers.go Outdated
Comment on lines +64 to +68
func closeRepo() {
if cachedRepo != nil {
_ = cachedRepo.Close()
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

In a multi-command execution environment (such as integration tests running multiple commands in the same process), cachedRepo is not reset to nil after being closed. This causes subsequent commands to retrieve the already-closed cachedRepo from getRepo(), leading to failures. Setting cachedRepo = nil after closing it ensures that subsequent calls can correctly reopen the repository.

Suggested change
func closeRepo() {
if cachedRepo != nil {
_ = cachedRepo.Close()
}
}
func closeRepo() {
if cachedRepo != nil {
_ = cachedRepo.Close()
cachedRepo = nil
}
}

Comment thread internal/git/git.go
Comment on lines +110 to +112
func (r *Repo) Close() error {
return r.gitRepo.Close()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To prevent potential nil-pointer dereferences, it is safer to add a nil check for both the receiver r and the underlying gitRepo before calling Close(). This aligns with defensive programming best practices.

func (r *Repo) Close() error {
	if r == nil || r.gitRepo == nil {
		return nil
	}
	return r.gitRepo.Close()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's probably a good comment

@tulioz tulioz marked this pull request as ready for review June 17, 2026 23:58
@tulioz tulioz requested a review from a team as a code owner June 17, 2026 23:58
@aviator-app

aviator-app Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

✅ FlexReview Status

Common Owner: aviator-co/engineering (expert-load-balance assignment)
Owner and Assignment:

  • aviator-co/engineering (expert-load-balance assignment)
    Owned Files
    • 🔒 go.mod
    • 🔒 go.sum
    • 🔒 cmd/av/adopt.go
    • 🔒 cmd/av/branch.go
    • 🔒 cmd/av/commit_common.go
    • 🔒 cmd/av/main.go
    • 🔒 cmd/av/reparent.go
    • 🔒 cmd/av/restack.go
    • 🔒 cmd/av/sync.go
    • 🔒 internal/actions/adopt_tree_selector.go
    • 🔒 internal/actions/find_adoptable_local_branches.go
    • 🔒 internal/git/diff_test.go
    • 🔒 internal/git/git.go
    • 🔒 internal/reorder/deletebranch_test.go
    • 🔒 internal/reorder/pick_test.go
    • 🔒 internal/reorder/plan_test.go
    • 🔒 internal/reorder/reorder_test.go
    • 🔒 internal/sequencer/sequencer.go
    • 🔒 internal/treedetector/detector.go
    • 🔒 internal/treedetector/util.go
    • 🔒 internal/gh/ghui/fetch.go
    • 🔒 internal/gh/ghui/push.go
    • 🔒 internal/git/gittest/repo.go
    • 🔒 internal/git/gitui/prune.go
    • 🔒 internal/sequencer/planner/planner.go
    • 🔒 internal/sequencer/planner/targets.go
    • 🔒 internal/sequencer/sequencerui/ui.go

Review SLO: 7 business hours if PR size is <= 200 LOC for the first response.

@aviator-app aviator-app Bot requested a review from brain-crystal June 17, 2026 23:58
Comment thread internal/git/git.go
Comment on lines +110 to +112
func (r *Repo) Close() error {
return r.gitRepo.Close()
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's probably a good comment

@aviator-app aviator-app Bot merged commit 3fd7a2d into master Jun 18, 2026
5 checks passed
@aviator-app aviator-app Bot deleted the bump-go-git-v6 branch June 18, 2026 19:17
@tulioz tulioz mentioned this pull request Jun 18, 2026
aviator-app Bot pushed a commit that referenced this pull request Jun 18, 2026
follow-up to #759, defensive nil guard on Repo.Close per review
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.

2 participants