Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

Commit af3567f

Browse files
committed
fix: show remote branches
1 parent 0ed67ac commit af3567f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

git/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ func (g *GitHandler) getShowRef(branchName string, filePath string) string {
4949
if dirPath == "." {
5050
dirPath += "/"
5151
}
52-
return branchName + ":" + dirPath
52+
return "origin/" + branchName + ":" + dirPath
5353
}

git/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ func (g *GitHandler) IsUpToDate() bool {
5454
}
5555

5656
func (g *GitHandler) GetBranches() []string {
57-
output, _ := g.runGitCommand("branch", "-l", "--no-color")
57+
output, _ := g.runGitCommand("branch", "-l", "-r", "--no-color")
5858
var branches []string
5959
for _, v := range strings.Split(output, "\n") {
60-
v = strings.TrimPrefix(v, "*")
6160
v = strings.TrimSpace(v)
61+
v = strings.TrimPrefix(v, "origin/")
6262
branches = append(branches, v)
6363
}
6464
return branches

0 commit comments

Comments
 (0)