feat: 细化 Git 状态诊断并升级 0.8.1
插件区分本机未安装 Git、目录非 Git 仓库与所有权被拒并显示具体原因;服务端提示改为“本机未提供 Git 状态”。同步文档当前版本,0.8.1 已部署 192.168.5.222 与本机,插件 38 项测试通过。
This commit is contained in:
1 parent
b46ebd1070
commit
95cb8b4e83
14 files changed
+87
-16
No files matched your search
+1
-1
@@ -182,7 +182,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/")
|
||||
fail := func(e error) { http.Error(w, e.Error(), 400) }
|
||||
if r.URL.Path == "/api/v1/health" {
|
||||
jsonOut(w, map[string]any{"version": "0.8.0", "installActions": true, "privateFileList": true, "remoteADB": true, "syncPreflight": true, "dedicatedGit": true, "adminCLI": true, "preflight": true, "textComparison": true, "jdkSelection": true, "workspaceSelection": true, "os": runtime.GOOS, "sync": "http-manifest", "recovery": true})
|
||||
jsonOut(w, map[string]any{"version": "0.8.1", "installActions": true, "privateFileList": true, "remoteADB": true, "syncPreflight": true, "dedicatedGit": true, "adminCLI": true, "preflight": true, "textComparison": true, "jdkSelection": true, "workspaceSelection": true, "os": runtime.GOOS, "sync": "http-manifest", "recovery": true})
|
||||
return
|
||||
}
|
||||
if r.URL.Path == "/api/v1/environment" && r.Method == "GET" {
|
||||
|
||||
+1
-1
@@ -404,7 +404,7 @@ func sourceInventoryMode(work string, dedicated bool) (map[string]File, error) {
|
||||
}
|
||||
func compareGit(local, remote *GitSnapshot) error {
|
||||
if remote != nil && local == nil {
|
||||
return fmt.Errorf("服务端存在 Git 仓库,但本机无法读取 Git 状态")
|
||||
return fmt.Errorf("服务端目录是 Git 仓库,但本机未提供 Git 状态;请确认本机工程是同一 Git 仓库且 Git 可用,或改用没有 .git 的服务端目录")
|
||||
}
|
||||
if local != nil && remote != nil && local.Head != remote.Head {
|
||||
return fmt.Errorf("两边 Git 提交不同,请先手动同步仓库;本机 HEAD=%s,服务端 HEAD=%s", local.Head, remote.Head)
|
||||
|
||||
Reference in new issue
Block a user