Skip to content

Commit 8b1d254

Browse files
committed
refactor(gitops): update fetch / checkout paths and hook command wiring for v2 + trail
- Comment and ref name updates for trace/checkpoints/v1 and refs/trace/ - Minor hook command adjustments to support the new trail/review event watching - Prep work for the broader trail feature on this branch
1 parent df76b88 commit 8b1d254

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

cmd/trace/cli/git_operations.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func IsOnDefaultBranch(ctx context.Context) (bool, string, error) {
128128
// If we couldn't determine from remote, use common defaults
129129
if defaultBranch == "" {
130130
// Check if current branch is a common default name
131-
if currentBranch == "main" || currentBranch == "master" {
131+
if currentBranch == defaultBaseBranch || currentBranch == masterBaseBranch {
132132
return true, currentBranch, nil
133133
}
134134
return false, currentBranch, nil
@@ -151,11 +151,11 @@ func getDefaultBranchFromRemote(repo *git.Repository) string {
151151
}
152152

153153
// Fallback: check if origin/main or origin/master exists
154-
if _, err := repo.Reference(plumbing.NewRemoteReferenceName("origin", "main"), true); err == nil {
155-
return "main"
154+
if _, err := repo.Reference(plumbing.NewRemoteReferenceName("origin", defaultBaseBranch), true); err == nil {
155+
return defaultBaseBranch
156156
}
157-
if _, err := repo.Reference(plumbing.NewRemoteReferenceName("origin", "master"), true); err == nil {
158-
return "master"
157+
if _, err := repo.Reference(plumbing.NewRemoteReferenceName("origin", masterBaseBranch), true); err == nil {
158+
return masterBaseBranch
159159
}
160160

161161
return ""

cmd/trace/cli/hooks_cmd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
_ "github.com/GrayCodeAI/trace/cmd/trace/cli/agent/factoryaidroid"
1717
_ "github.com/GrayCodeAI/trace/cmd/trace/cli/agent/geminicli"
1818
_ "github.com/GrayCodeAI/trace/cmd/trace/cli/agent/opencode"
19+
_ "github.com/GrayCodeAI/trace/cmd/trace/cli/agent/pi"
1920
_ "github.com/GrayCodeAI/trace/cmd/trace/cli/agent/vogon"
2021

2122
// support external agents

0 commit comments

Comments
 (0)