backup: implement --skip-if-unchanged

This commit is contained in:
Michael Eischer
2024-05-22 16:38:00 +02:00
parent 7b4f81d964
commit 6869bdaaa8
6 changed files with 52 additions and 14 deletions

View File

@@ -641,3 +641,18 @@ func TestBackupEmptyPassword(t *testing.T) {
testListSnapshots(t, env.gopts, 1)
testRunCheck(t, env.gopts)
}
func TestBackupSkipIfUnchanged(t *testing.T) {
env, cleanup := withTestEnvironment(t)
defer cleanup()
testSetupBackupData(t, env)
opts := BackupOptions{SkipIfUnchanged: true}
for i := 0; i < 3; i++ {
testRunBackup(t, filepath.Dir(env.testdata), []string{"testdata"}, opts, env.gopts)
testListSnapshots(t, env.gopts, 1)
}
testRunCheck(t, env.gopts)
}