From 931187f49339a38738241123451968be672667bb Mon Sep 17 00:00:00 2001 From: beads/crew/grip Date: Mon, 12 Jan 2026 19:43:44 -0800 Subject: [PATCH] fix: remove unused error return from getCurrentBranchOrHEAD The function always returns nil for error since it is designed to return HEAD on detached HEAD state. Simplify signature to just return string. Fixes golangci-lint unparam warning. Co-Authored-By: Claude Opus 4.5 --- cmd/bd/sync_branch.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/cmd/bd/sync_branch.go b/cmd/bd/sync_branch.go index ffd376e2..c988539a 100644 --- a/cmd/bd/sync_branch.go +++ b/cmd/bd/sync_branch.go @@ -25,13 +25,13 @@ func getCurrentBranch(ctx context.Context) (string, error) { // getCurrentBranchOrHEAD returns the current branch name, or "HEAD" if in detached HEAD state. // This is useful for jj/jujutsu compatibility where HEAD is always detached but we still // need a reference for git operations like log and diff. -func getCurrentBranchOrHEAD(ctx context.Context) (string, error) { +func getCurrentBranchOrHEAD(ctx context.Context) string { branch, err := getCurrentBranch(ctx) if err != nil { // Detached HEAD - return "HEAD" as the reference - return "HEAD", nil + return "HEAD" } - return branch, nil + return branch } // getSyncBranch returns the configured sync branch name @@ -59,10 +59,7 @@ func showSyncStatus(ctx context.Context) error { return fmt.Errorf("not in a git repository") } - currentBranch, err := getCurrentBranchOrHEAD(ctx) - if err != nil { - return err - } + currentBranch := getCurrentBranchOrHEAD(ctx) syncBranch, err := getSyncBranch(ctx) if err != nil {