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:
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user