Compare commits
2 Commits
master
...
dev_educod
Author | SHA1 | Date |
---|---|---|
xxq250 | b1142b9b68 | |
xxq250 | b2624f6562 |
|
@ -59,7 +59,8 @@ func GetCodeActivityStatsWithoutSince(repo *gitea_git.Repository, branch string)
|
|||
if len(branch) == 0 {
|
||||
gitCmd.AddArguments("--branches=*")
|
||||
} else {
|
||||
gitCmd.AddArguments("--first-parent").AddDynamicArguments(branch)
|
||||
//gitCmd.AddArguments("--first-parent").AddDynamicArguments(branch)
|
||||
gitCmd.AddArguments("--branches").AddDynamicArguments(branch)
|
||||
}
|
||||
|
||||
stderr := new(strings.Builder)
|
||||
|
|
|
@ -137,12 +137,12 @@ func GetReadmeContents(ctx *context.APIContext) {
|
|||
readmeSortArr := []string{"readme", "readme.en.md", "readme_en.md", "readme.md", "readme.ch.md", "readme_ch.md", "readme.zh.md", "readme_zh.md", "readme.cn.md", "readme_cn.md"}
|
||||
readmePath := ""
|
||||
readmePathInArrIndex := 0
|
||||
filesListInterface, err := files_service.GetContentsOrList(ctx, ctx.Repo.Repository, "", ref)
|
||||
filesListInterface, err := hat_files_service.GetContentsOrList(ctx, ctx.Repo.Repository, "", ref)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetContentsOrList", err)
|
||||
return
|
||||
}
|
||||
filesList, ok := filesListInterface.([]*api.ContentsResponse)
|
||||
filesList, ok := filesListInterface.([]*hat_api.ContentsResponse)
|
||||
if ok {
|
||||
for _, file := range filesList {
|
||||
for i, sortItem := range readmeSortArr {
|
||||
|
|
|
@ -134,7 +134,9 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var isTextFile = false
|
||||
|
||||
if !entry.IsSubModule() {
|
||||
blob, err := gitRepo.GetBlob(entry.ID.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -148,7 +150,8 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
|
|||
buf = buf[:n]
|
||||
|
||||
st := typesniffer.DetectContentType(buf)
|
||||
isTextFile := st.IsText()
|
||||
isTextFile = st.IsText()
|
||||
}
|
||||
|
||||
contentsResponse := &hat_api.ContentsResponse{
|
||||
ContentsResponse: &gitea_api.ContentsResponse{
|
||||
|
|
Loading…
Reference in New Issue