Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1748 Reviewed-by: lewis <747342561@qq.com>tags/v1.22.3.2^2
| @@ -2715,7 +2715,7 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi | |||||
| log.Error("ReadLatestFileInRepo error when OpenRepository,error=%v", err) | log.Error("ReadLatestFileInRepo error when OpenRepository,error=%v", err) | ||||
| return nil, err | return nil, err | ||||
| } | } | ||||
| commitID, err := gitRepo.GetBranchCommitID(refName) | |||||
| _, err = gitRepo.GetBranchCommitID(refName) | |||||
| if err != nil { | if err != nil { | ||||
| log.Error("ReadLatestFileInRepo error when GetBranchCommitID,error=%v", err) | log.Error("ReadLatestFileInRepo error when GetBranchCommitID,error=%v", err) | ||||
| return nil, err | return nil, err | ||||
| @@ -2747,5 +2747,9 @@ func ReadLatestFileInRepo(userName, repoName, refName, treePath string) (*RepoFi | |||||
| if n >= 0 { | if n >= 0 { | ||||
| buf = buf[:n] | 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 | |||||
| } | } | ||||
| @@ -215,10 +215,10 @@ var _hmt = _hmt || []; | |||||
| localStorage.setItem("isCloseNotice",true) | localStorage.setItem("isCloseNotice",true) | ||||
| } | } | ||||
| function isShowNotice(){ | function isShowNotice(){ | ||||
| var current_notice = localStorage.getItem("notice") | |||||
| var current_notice = localStorage.getItem("notices") | |||||
| if (current_notice != "{{.notice.CommitId}}"){ | |||||
| localStorage.setItem('notice',"{{.notice.CommitId}}"); | |||||
| if (current_notice != "{{.notices.CommitId}}"){ | |||||
| localStorage.setItem('notices',"{{.notices.CommitId}}"); | |||||
| isNewNotice=true; | isNewNotice=true; | ||||
| localStorage.setItem("isCloseNotice",false) | localStorage.setItem("isCloseNotice",false) | ||||
| }else{ | }else{ | ||||
| @@ -216,10 +216,10 @@ var _hmt = _hmt || []; | |||||
| localStorage.setItem("isCloseNotice",true) | localStorage.setItem("isCloseNotice",true) | ||||
| } | } | ||||
| function isShowNotice(){ | function isShowNotice(){ | ||||
| var current_notice = localStorage.getItem("notice") | |||||
| var current_notice = localStorage.getItem("notices") | |||||
| if (current_notice != "{{.notice.CommitId}}"){ | |||||
| localStorage.setItem('notice',"{{.notice.CommitId}}"); | |||||
| if (current_notice != "{{.notices.CommitId}}"){ | |||||
| localStorage.setItem('notices',"{{.notices.CommitId}}"); | |||||
| isNewNotice=true; | isNewNotice=true; | ||||
| localStorage.setItem("isCloseNotice",false) | localStorage.setItem("isCloseNotice",false) | ||||
| }else{ | }else{ | ||||
| @@ -220,10 +220,10 @@ var _hmt = _hmt || []; | |||||
| localStorage.setItem("isCloseNotice",true) | localStorage.setItem("isCloseNotice",true) | ||||
| } | } | ||||
| function isShowNotice(){ | function isShowNotice(){ | ||||
| var current_notice = localStorage.getItem("notice") | |||||
| var current_notice = localStorage.getItem("notices") | |||||
| if (current_notice != "{{.notice.CommitId}}"){ | |||||
| localStorage.setItem('notice',"{{.notice.CommitId}}"); | |||||
| if (current_notice != "{{.notices.CommitId}}"){ | |||||
| localStorage.setItem('notices',"{{.notices.CommitId}}"); | |||||
| isNewNotice=true; | isNewNotice=true; | ||||
| localStorage.setItem("isCloseNotice",false) | localStorage.setItem("isCloseNotice",false) | ||||
| }else{ | }else{ | ||||
| @@ -217,10 +217,10 @@ var _hmt = _hmt || []; | |||||
| localStorage.setItem("isCloseNotice",true) | localStorage.setItem("isCloseNotice",true) | ||||
| } | } | ||||
| function isShowNotice(){ | function isShowNotice(){ | ||||
| var current_notice = localStorage.getItem("notice") | |||||
| var current_notice = localStorage.getItem("notices") | |||||
| if (current_notice != "{{.notice.CommitId}}"){ | |||||
| localStorage.setItem('notice',"{{.notice.CommitId}}"); | |||||
| if (current_notice != "{{.notices.CommitId}}"){ | |||||
| localStorage.setItem('notices',"{{.notices.CommitId}}"); | |||||
| isNewNotice=true; | isNewNotice=true; | ||||
| localStorage.setItem("isCloseNotice",false) | localStorage.setItem("isCloseNotice",false) | ||||
| }else{ | }else{ | ||||