Support attaching existing Restic repositories

This commit is contained in:
Mikei386
2026-06-15 12:01:24 +02:00
parent e97dde0ed8
commit 3327f21881
11 changed files with 115 additions and 15 deletions
+1 -1
View File
@@ -414,7 +414,7 @@ func resticError(message string, commandErr error) error {
case strings.Contains(lower, "wrong password") || strings.Contains(lower, "no key found"):
return errors.New("authentication: wrong repository password. Enter the original Restic password under Edit and select Test")
case strings.Contains(lower, "repository does not exist") || strings.Contains(lower, "is there a repository at the following location?"):
return errors.New("repository: destination is not initialized; open Repositories and select Initialize once")
return errors.New("repository: Am konfigurierten Ziel wurde keine Restic-config gefunden. Für ein vorhandenes Repository den exakten Repository-Ordner eintragen; nur ein wirklich neues, leeres Ziel initialisieren")
default:
message = strings.TrimSpace(strings.TrimPrefix(message, "Fatal:"))
return fmt.Errorf("restic: %s: %w", message, commandErr)
+7
View File
@@ -298,6 +298,13 @@ func TestResticErrorExplainsCiphertextVerification(t *testing.T) {
}
}
func TestResticErrorExplainsMissingExistingRepositoryPath(t *testing.T) {
err := resticError("Fatal: repository does not exist", fmt.Errorf("exit status 10"))
if !strings.Contains(err.Error(), "exakten Repository-Ordner") || !strings.Contains(err.Error(), "wirklich neues") {
t.Fatalf("unexpected error: %v", err)
}
}
func TestRunnerPausesResumesAndCancelsProcessGroup(t *testing.T) {
dir := t.TempDir()
ticksPath := filepath.Join(dir, "ticks")