From 5244ab7656e2269676cf6296718c8e5243c5b919 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Apr 2013 16:26:55 -0400 Subject: 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.) --- Assistant/Types/Changes.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Assistant/Types') 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 -- cgit v1.2.3