From cd776ecb2ee7cb90ca49b8f84fd2502e1859bdfd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 4 Jan 2021 12:38:43 -0400 Subject: [PATCH] avoid combining queued commands with different params I don't think this affected git-annex currently, but if the same command was queued twice with different params, one set of params was thrown away, and the files going with those were run with the other set of params. --- Git/Queue.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Git/Queue.hs b/Git/Queue.hs index 90b7e2279f..50faa9f4d9 100644 --- a/Git/Queue.hs +++ b/Git/Queue.hs @@ -55,12 +55,15 @@ instance Eq (InternalActionRunner m) where InternalActionRunner s1 _ == InternalActionRunner s2 _ = s1 == s2 {- A key that can uniquely represent an action in a Map. -} -data ActionKey = UpdateIndexActionKey | CommandActionKey String | InternalActionKey String +data ActionKey + = UpdateIndexActionKey + | CommandActionKey String [CommandParam] + | InternalActionKey String deriving (Eq, Ord) actionKey :: Action m -> ActionKey actionKey (UpdateIndexAction _) = UpdateIndexActionKey -actionKey CommandAction { getSubcommand = s } = CommandActionKey s +actionKey CommandAction { getSubcommand = s, getParams = p } = CommandActionKey s p actionKey InternalAction { getRunner = InternalActionRunner s _ } = InternalActionKey s {- A queue of actions to perform (in any order) on a git repository, -- 2.30.2