plumb MeterUpdate into getKey

No behavior changes, but this shows everywhere that a progress meter
could be displayed when hashing a file to add to the annex.

Many of the places don't make sense to display a progress meter though,
eg when importing the copy of the file probably swamps the hashing of
the file.
This commit is contained in:
Joey Hess 2019-06-25 11:37:52 -04:00
parent 191bdaafc5
commit 8355dba5cc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
18 changed files with 60 additions and 44 deletions

View file

@ -32,6 +32,7 @@ import Git.FilePath
import Git.Types
import Git.Branch
import Types.Import
import Utility.Metered
import Control.Concurrent.STM
@ -198,7 +199,7 @@ startLocal largematcher mode (srcfile, destfile) =
}
}
ifM (checkFileMatcher largematcher destfile)
( ingestAdd' (Just ld') (Just k)
( ingestAdd' nullMeterUpdate (Just ld') (Just k)
>>= maybe
stop
(\addedk -> next $ Command.Add.cleanup addedk True)
@ -219,7 +220,7 @@ startLocal largematcher mode (srcfile, destfile) =
case v of
Just ld -> do
backend <- chooseBackend destfile
v' <- genKey (keySource ld) backend
v' <- genKey (keySource ld) nullMeterUpdate backend
case v' of
Just (k, _) -> a (ld, k)
Nothing -> giveup "failed to generate a key"