diff --git a/models/repo_indexer.go b/models/repo_indexer.go index c9540b8b4..673a0743a 100644 --- a/models/repo_indexer.go +++ b/models/repo_indexer.go @@ -177,7 +177,7 @@ type fileUpdate struct { } func getDefaultBranchSha(repo *Repository) (string, error) { - stdout, err := git.NewCommand("show-ref", "-s", repo.DefaultBranch).RunInDir(repo.RepoPath()) + stdout, err := git.NewCommand("show-ref", "-s", git.BranchPrefix+repo.DefaultBranch).RunInDir(repo.RepoPath()) if err != nil { return "", err }