fix: update tests for getCurrentBranchOrHEAD and getPIDFileForSocket
- sync_git_test.go: getCurrentBranchOrHEAD now returns 1 value (not 2) - daemon_basics_test.go: getPIDFileForSocket uses dbPath not socketPath - daemon_autostart.go: mark unused socketPath param with underscore These tests were broken by recent refactors that changed function signatures but didn't update the corresponding test files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -607,10 +607,7 @@ func TestGetCurrentBranchOrHEAD(t *testing.T) {
|
||||
|
||||
// Test 1: Normal branch returns branch name
|
||||
t.Run("returns branch name when on branch", func(t *testing.T) {
|
||||
branch, err := getCurrentBranchOrHEAD(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("getCurrentBranchOrHEAD() error = %v", err)
|
||||
}
|
||||
branch := getCurrentBranchOrHEAD(ctx)
|
||||
if branch != "main" {
|
||||
t.Errorf("getCurrentBranchOrHEAD() = %q, want %q", branch, "main")
|
||||
}
|
||||
@@ -625,10 +622,7 @@ func TestGetCurrentBranchOrHEAD(t *testing.T) {
|
||||
t.Fatalf("Failed to detach HEAD: %v\n%s", err, out)
|
||||
}
|
||||
|
||||
branch, err := getCurrentBranchOrHEAD(ctx)
|
||||
if err != nil {
|
||||
t.Errorf("getCurrentBranchOrHEAD() error = %v", err)
|
||||
}
|
||||
branch := getCurrentBranchOrHEAD(ctx)
|
||||
if branch != "HEAD" {
|
||||
t.Errorf("getCurrentBranchOrHEAD() = %q, want %q", branch, "HEAD")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user