summaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-24 16:26:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-24 16:29:25 -0400
commit5244ab7656e2269676cf6296718c8e5243c5b919 (patch)
treeeff2f55cfc39592de5fca8691b591c79340932ba /Assistant
parent5c49f7ef10b8d61cfabd8ca9602d852ae5abe452 (diff)
convert PendingAddChange back to Change when an add fails
If an add failed, we should lose the KeySource, since it, presumably, differs due to a change that was made to the file. (The locked down file is already deleted.)
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Committer.hs2
-rw-r--r--Assistant/Types/Changes.hs5
2 files changed, 6 insertions, 1 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 8fe48bfb7..ea3f01fc5 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -302,7 +302,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
recordedInodeCache k
failedingest change = do
- refill [change]
+ refill [retryChange change]
liftAnnex showEndFail
return Nothing
diff --git a/Assistant/Types/Changes.hs b/Assistant/Types/Changes.hs
index 81fd527a6..c5680a0e6 100644
--- a/Assistant/Types/Changes.hs
+++ b/Assistant/Types/Changes.hs
@@ -63,6 +63,11 @@ isInProcessAddChange :: Change -> Bool
isInProcessAddChange (InProcessAddChange {}) = True
isInProcessAddChange _ = False
+retryChange :: Change -> Change
+retryChange (InProcessAddChange time ks) =
+ Change time (keyFilename ks) AddFileChange
+retryChange c = c
+
finishedChange :: Change -> Key -> Change
finishedChange c@(InProcessAddChange { keySource = ks }) k = Change
{ changeTime = changeTime c