Skip to content

Commit

Permalink
Merge pull request #72 from src-d/warns
Browse files Browse the repository at this point in the history
pga: avoid warning when local copy doesn't exist
  • Loading branch information
vmarkovtsev authored Jul 26, 2018
2 parents ce68993 + 731dc13 commit 5a19640
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions PublicGitArchive/pga/cmd/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,9 @@ func upToDate(dest, source FileSystem, name string) bool {
if err == nil {
return ok
}
logrus.Warnf("could not check md5 hashes for %s, comparing timestamps instead: %v", name, err)

localTime, err := dest.ModTime(name)
if err != nil {
logrus.Warnf("could not check mod time in %s: %v", dest.Abs(name), err)
return false
}

Expand All @@ -126,6 +124,7 @@ func matchHash(dest, source FileSystem, name string) (bool, error) {
}
remoteHash, err := source.MD5(name)
if err != nil {
logrus.Warnf("could not check md5 hashes for %s: %v", source.Abs(name), err)
return false, err
}
return localHash == remoteHash, nil
Expand Down

0 comments on commit 5a19640

Please sign in to comment.