v0.7.4 - Verification depot distant et suppression popups erreur
Changements : - Verification du depot distant via git ls-remote avant de proposer le clone - Affichage "Depot introuvable" si l'URL pointe vers un repo inexistant - Remplacement des popups d'erreur par des messages dans le journal Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
17
git.go
17
git.go
@@ -69,6 +69,23 @@ func checkRepo(cfg RepoConfig) RepoResult {
|
||||
res.Path = local
|
||||
|
||||
if _, err := os.Stat(filepath.Join(local, ".git")); os.IsNotExist(err) {
|
||||
// Vérifier que le dépôt distant existe avant de proposer le clone
|
||||
code, _, stderr := runGit([]string{"ls-remote", "--exit-code", cfg.URL}, "", 15*time.Second)
|
||||
if code != 0 {
|
||||
for _, kw := range []string{"could not resolve", "connection refused", "unable to connect", "timed out", "the remote end hung up"} {
|
||||
if strings.Contains(strings.ToLower(stderr), kw) {
|
||||
res.Offline = true
|
||||
res.Error = "Hors ligne"
|
||||
return res
|
||||
}
|
||||
}
|
||||
if strings.Contains(strings.ToLower(stderr), "not found") || strings.Contains(strings.ToLower(stderr), "repository not found") {
|
||||
res.Error = "Dépôt introuvable : " + cfg.URL
|
||||
return res
|
||||
}
|
||||
res.Error = "Erreur remote : " + stderr
|
||||
return res
|
||||
}
|
||||
res.NeedsClone = true
|
||||
return res
|
||||
}
|
||||
|
||||
2
gui.go
2
gui.go
@@ -522,7 +522,7 @@ func (a *App) doAction() {
|
||||
a.mw.Synchronize(func() {
|
||||
if err != nil {
|
||||
a.model.setProgress(idx, 0, "Erreur")
|
||||
walk.MsgBox(a.mw, "Erreur", res.Name+"\n\n"+err.Error(), walk.MsgBoxIconError)
|
||||
a.appendLog(fmt.Sprintf("[%s] Erreur: %v", res.Name, err))
|
||||
logError(fmt.Sprintf("[%s] %v", res.Name, err))
|
||||
} else {
|
||||
a.model.setProgress(idx, 1.0, progressBarText(1.0, 20, "Terminé"))
|
||||
|
||||
2
main.go
2
main.go
@@ -9,7 +9,7 @@ import (
|
||||
"github.com/lxn/walk"
|
||||
)
|
||||
|
||||
const VERSION = "0.7.3"
|
||||
const VERSION = "0.7.4"
|
||||
|
||||
func exeDir() string {
|
||||
exe, err := os.Executable()
|
||||
|
||||
@@ -1 +1 @@
|
||||
0.7.3
|
||||
0.7.4
|
||||
|
||||
Reference in New Issue
Block a user