v0.7.6 - Clone dossier non-vide et verification rapide
Changements : - Clone dans dossier non-vide (git init + remote add + fetch + checkout) - Verification rapide via git ls-remote au lieu de git fetch (timeout 15s) - Support branche par repo dans config.ini (champ branch) - Suppression fichiers Python et artefacts PyInstaller (_internal/) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
48
gui.go
48
gui.go
@@ -36,26 +36,20 @@ func (it *RepoItem) statusText() string {
|
||||
if r.UpToDate {
|
||||
return "À jour"
|
||||
}
|
||||
msg := ""
|
||||
if r.NewCommits > 0 {
|
||||
msg = fmt.Sprintf("%d commit(s)", r.NewCommits)
|
||||
var parts []string
|
||||
if r.HasUpdate {
|
||||
parts = append(parts, "MAJ disponible")
|
||||
}
|
||||
if r.LocalChanges > 0 {
|
||||
if msg != "" {
|
||||
msg += ", "
|
||||
}
|
||||
msg += fmt.Sprintf("%d modif. locale(s)", r.LocalChanges)
|
||||
parts = append(parts, fmt.Sprintf("%d modif. locale(s)", r.LocalChanges))
|
||||
}
|
||||
if r.UntrackedFiles > 0 {
|
||||
if msg != "" {
|
||||
msg += ", "
|
||||
}
|
||||
msg += fmt.Sprintf("%d fichier(s) en trop", r.UntrackedFiles)
|
||||
parts = append(parts, fmt.Sprintf("%d fichier(s) en trop", r.UntrackedFiles))
|
||||
}
|
||||
if msg == "" {
|
||||
if len(parts) == 0 {
|
||||
return "À jour"
|
||||
}
|
||||
return msg
|
||||
return strings.Join(parts, ", ")
|
||||
}
|
||||
|
||||
// progressBarText génère une barre de progression visuelle en Unicode.
|
||||
@@ -201,7 +195,7 @@ func (m *RepoModel) hasUpdates() bool {
|
||||
defer m.mu.RUnlock()
|
||||
for _, it := range m.items {
|
||||
r := it.result
|
||||
if !r.Pending && r.Error == "" && !r.Offline && (r.NewCommits > 0 || r.LocalChanges > 0 || r.UntrackedFiles > 0 || r.NeedsClone) {
|
||||
if !r.Pending && r.Error == "" && !r.Offline && (r.HasUpdate || r.LocalChanges > 0 || r.UntrackedFiles > 0 || r.NeedsClone) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -426,23 +420,17 @@ func logLineForResult(r RepoResult) string {
|
||||
if r.UpToDate {
|
||||
return "À jour"
|
||||
}
|
||||
msg := ""
|
||||
if r.NewCommits > 0 {
|
||||
msg += fmt.Sprintf("%d commit(s) disponible(s)", r.NewCommits)
|
||||
var parts []string
|
||||
if r.HasUpdate {
|
||||
parts = append(parts, "MAJ disponible")
|
||||
}
|
||||
if r.LocalChanges > 0 {
|
||||
if msg != "" {
|
||||
msg += ", "
|
||||
}
|
||||
msg += fmt.Sprintf("%d modif. locale(s)", r.LocalChanges)
|
||||
parts = append(parts, fmt.Sprintf("%d modif. locale(s)", r.LocalChanges))
|
||||
}
|
||||
if r.UntrackedFiles > 0 {
|
||||
if msg != "" {
|
||||
msg += ", "
|
||||
}
|
||||
msg += fmt.Sprintf("%d fichier(s) en trop", r.UntrackedFiles)
|
||||
parts = append(parts, fmt.Sprintf("%d fichier(s) en trop", r.UntrackedFiles))
|
||||
}
|
||||
return msg
|
||||
return strings.Join(parts, ", ")
|
||||
}
|
||||
|
||||
// recheckOne re-vérifie un seul dépôt sans toucher aux autres.
|
||||
@@ -534,7 +522,7 @@ func (a *App) onSelectionChanged() {
|
||||
if res.NeedsClone {
|
||||
a.btnAction.SetText("Cloner")
|
||||
a.btnAction.SetEnabled(true)
|
||||
} else if res.NewCommits > 0 || res.LocalChanges > 0 || res.UntrackedFiles > 0 {
|
||||
} else if res.HasUpdate || res.LocalChanges > 0 || res.UntrackedFiles > 0 {
|
||||
a.btnAction.SetText("Mettre à jour")
|
||||
a.btnAction.SetEnabled(true)
|
||||
} else {
|
||||
@@ -551,7 +539,7 @@ func (a *App) doAction() {
|
||||
cfg := a.reposConfig[idx]
|
||||
|
||||
// Si uniquement des fichiers en trop, proposer directement le nettoyage
|
||||
if res.UntrackedFiles > 0 && res.NewCommits == 0 && res.LocalChanges == 0 && !res.NeedsClone {
|
||||
if res.UntrackedFiles > 0 && !res.HasUpdate && res.LocalChanges == 0 && !res.NeedsClone {
|
||||
a.proposeClean(idx, res)
|
||||
return
|
||||
}
|
||||
@@ -568,7 +556,7 @@ func (a *App) doAction() {
|
||||
if res.LocalChanges > 0 {
|
||||
err = doCheckout(res)
|
||||
}
|
||||
if err == nil && res.NewCommits > 0 {
|
||||
if err == nil && res.HasUpdate {
|
||||
err = doPullWithProgress(res, cb)
|
||||
}
|
||||
}
|
||||
@@ -614,7 +602,7 @@ func (a *App) updateAll() {
|
||||
if res.LocalChanges > 0 {
|
||||
err = doCheckout(res)
|
||||
}
|
||||
if err == nil && res.NewCommits > 0 {
|
||||
if err == nil && res.HasUpdate {
|
||||
err = doPullWithProgress(res, cb)
|
||||
}
|
||||
if err == nil && res.UntrackedFiles > 0 {
|
||||
|
||||
Reference in New Issue
Block a user