From 21cfd0ea980feaec8875380707c1a1ddb91de5dc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Aug 2022 13:46:43 -0400 Subject: [PATCH] fix reversion 3a513cfe73ed873aeeabbc17d2c458b62dd4198c 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 --- Command/AddUrl.hs | 3 ++- ...eems_have_introduced_a___34__regression__34__.mdwn | 1 + ...omment_4_ee9f695290b1bcaf2c9320d8042047cc._comment | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__/comment_4_ee9f695290b1bcaf2c9320d8042047cc._comment diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 805e72a0e7..830cc09251 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -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)] diff --git a/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__.mdwn b/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__.mdwn index 4c2b432777..c22436a01d 100644 --- a/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__.mdwn +++ b/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__.mdwn @@ -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]] diff --git a/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__/comment_4_ee9f695290b1bcaf2c9320d8042047cc._comment b/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__/comment_4_ee9f695290b1bcaf2c9320d8042047cc._comment new file mode 100644 index 0000000000..8ef220c9f4 --- /dev/null +++ b/doc/bugs/add_--dry-run_seems_have_introduced_a___34__regression__34__/comment_4_ee9f695290b1bcaf2c9320d8042047cc._comment @@ -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. +"""]]