Fix --dry-run not working and add tests for it - fixes #3

This commit is contained in:
Nick Craig-Wood
2014-06-26 15:33:06 +01:00
parent 1d67b014cb
commit 7ebf48ef42
3 changed files with 39 additions and 4 deletions
+1 -1
View File
@@ -70,10 +70,10 @@ func LoadConfig() {
// FIXME read these from the config file too
Config.Verbose = *verbose
Config.Quiet = *quiet
Config.Quiet = *dryRun
Config.ModifyWindow = *modifyWindow
Config.Checkers = *checkers
Config.Transfers = *transfers
Config.DryRun = *dryRun
ConfigPath = *configFile
+5 -1
View File
@@ -178,7 +178,11 @@ func Copier(in ObjectPairChan, fdst Fs, wg *sync.WaitGroup) {
for pair := range in {
src := pair.src
Stats.Transferring(src)
Copy(fdst, pair.dst, src)
if Config.DryRun {
Debug(src, "Not copying as --dry-run")
} else {
Copy(fdst, pair.dst, src)
}
Stats.DoneTransferring(src)
}
}