fix reversion

3a513cfe73 caused a reversion in addurl.
The type of addSmall changed, but the void prevented the type checker
from helping notice this. Since it now returns a CommandPerform, the
cleanup action has to be run.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-08-09 13:46:43 -04:00
parent eb2acf5fd7
commit 21cfd0ea98
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 14 additions and 1 deletions

View file

@ -476,7 +476,8 @@ addWorkTree _ addunlockedmatcher u url file key mtmp = case mtmp of
(fromRawFilePath file)
(fromRawFilePath tmp)
go
else void $ Command.Add.addSmall (DryRun False) file s
else Command.Add.addSmall (DryRun False) file s
>>= maybe noop void
where
go = do
maybeShowJSON $ JSONChunk [("key", serializeKey key)]

View file

@ -59,3 +59,4 @@ I will try to dig deeper some time later, unless you Joey immediately see what c
[[!meta author=yoh]]
[[!tag projects/datalad]]
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,11 @@
[[!comment format=mdwn
username="joey"
subject="""comment 4"""
date="2022-08-09T17:35:46Z"
content="""
Found the bug.. it is in the change to Command.AddUrl. Since addSmall
changed to a CommandPerform, `void $ Command.Add.addSmall ...` only
now runs the first part of it, but not the action that returns that
actually adds the file to git! The `void` causes that to get thrown
away. Easily fixed.
"""]]