summaryrefslogtreecommitdiff
path: root/Types/ActionItem.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2021-03-12 14:09:19 -0400
committerJoey Hess <joeyh@joeyh.name>2021-03-12 14:11:31 -0400
commit6481991208f4fb3dbc2b60899c3bf2e37c76c9f3 (patch)
treefeec49c7e03edffa96d9cd67c5502a62b24ee26f /Types/ActionItem.hs
parentf87c63d998407d6ad779fbcfc8b9e652765559b6 (diff)
export --json: Fill in the file field
Like import was using ActionItemWorkTreeFile, it's ok to use it for export, even though it might not correspond with a file in the work tree. And renamed it to ActionItemTreeFile to make that clearer. Note that when an export has to rename files, it still uses ActionItemOther, so file will still be null in that case, but as no file is being transferred, that seems ok.
Diffstat (limited to 'Types/ActionItem.hs')
-rw-r--r--Types/ActionItem.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/Types/ActionItem.hs b/Types/ActionItem.hs
index fcb8c64345..b5d52f5401 100644
--- a/Types/ActionItem.hs
+++ b/Types/ActionItem.hs
@@ -22,7 +22,7 @@ data ActionItem
| ActionItemKey Key
| ActionItemBranchFilePath BranchFilePath Key
| ActionItemFailedTransfer Transfer TransferInfo
- | ActionItemWorkTreeFile RawFilePath
+ | ActionItemTreeFile RawFilePath
| ActionItemOther (Maybe String)
-- Use to avoid more than one thread concurrently processing the
-- same Key.
@@ -64,7 +64,7 @@ actionItemDesc (ActionItemKey k) = serializeKey' k
actionItemDesc (ActionItemBranchFilePath bfp _) = descBranchFilePath bfp
actionItemDesc (ActionItemFailedTransfer t i) = actionItemDesc $
ActionItemAssociatedFile (associatedFile i) (transferKey t)
-actionItemDesc (ActionItemWorkTreeFile f) = f
+actionItemDesc (ActionItemTreeFile f) = f
actionItemDesc (ActionItemOther s) = encodeBS' (fromMaybe "" s)
actionItemDesc (OnlyActionOn _ ai) = actionItemDesc ai
@@ -73,15 +73,15 @@ actionItemKey (ActionItemAssociatedFile _ k) = Just k
actionItemKey (ActionItemKey k) = Just k
actionItemKey (ActionItemBranchFilePath _ k) = Just k
actionItemKey (ActionItemFailedTransfer t _) = Just (transferKey t)
-actionItemKey (ActionItemWorkTreeFile _) = Nothing
+actionItemKey (ActionItemTreeFile _) = Nothing
actionItemKey (ActionItemOther _) = Nothing
actionItemKey (OnlyActionOn _ ai) = actionItemKey ai
-actionItemWorkTreeFile :: ActionItem -> Maybe RawFilePath
-actionItemWorkTreeFile (ActionItemAssociatedFile (AssociatedFile af) _) = af
-actionItemWorkTreeFile (ActionItemWorkTreeFile f) = Just f
-actionItemWorkTreeFile (OnlyActionOn _ ai) = actionItemWorkTreeFile ai
-actionItemWorkTreeFile _ = Nothing
+actionItemFile :: ActionItem -> Maybe RawFilePath
+actionItemFile (ActionItemAssociatedFile (AssociatedFile af) _) = af
+actionItemFile (ActionItemTreeFile f) = Just f
+actionItemFile (OnlyActionOn _ ai) = actionItemFile ai
+actionItemFile _ = Nothing
actionItemTransferDirection :: ActionItem -> Maybe Direction
actionItemTransferDirection (ActionItemFailedTransfer t _) = Just $