req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/raw/%s/README.md", user.Name, ref)
session.MakeRequest(t, req, http.StatusOK)
}
+ // Test default branch
+ req := NewRequestf(t, "GET", "/api/v1/repos/%s/repo1/raw/README.md", user.Name)
+ session.MakeRequest(t, req, http.StatusOK)
}
if refName := getRefName(ctx, RepoRefTag); len(refName) > 0 {
return refName
}
- return getRefName(ctx, RepoRefCommit)
+ if refName := getRefName(ctx, RepoRefCommit); len(refName) > 0 {
+ return refName
+ }
+ ctx.Repo.TreePath = path
+ return ctx.Repo.Repository.DefaultBranch
case RepoRefBranch:
return getRefNameFromPath(ctx, path, ctx.Repo.GitRepo.IsBranchExist)
case RepoRefTag: