|
|
|
@@ -2715,7 +2715,7 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi |
|
|
|
log.Error("ReadLatestFileInRepo error when OpenRepository,error=%v", err) |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
commitID, err := gitRepo.GetBranchCommitID(refName) |
|
|
|
_, err = gitRepo.GetBranchCommitID(refName) |
|
|
|
if err != nil { |
|
|
|
log.Error("ReadLatestFileInRepo error when GetBranchCommitID,error=%v", err) |
|
|
|
return nil, err |
|
|
|
@@ -2747,5 +2747,9 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi |
|
|
|
if n >= 0 { |
|
|
|
buf = buf[:n] |
|
|
|
} |
|
|
|
return &RepoFile{CommitId: commitID, Content: buf}, nil |
|
|
|
commitId := "" |
|
|
|
if blob != nil { |
|
|
|
commitId = fmt.Sprint(blob.ID) |
|
|
|
} |
|
|
|
return &RepoFile{CommitId: commitId, Content: buf}, nil |
|
|
|
} |