aboutsummaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-18 12:12:11 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-18 12:38:07 -0400
commit9d2ac4d87dc98bd2ab60da38a7e98f0964fd1595 (patch)
treecd3721adab7588d4d3814a26a58f748117700820 /Command
parentd5c5e3176d42ca627f21c977c49f1e234f5c1b1a (diff)
lock to avoid more than one export to a remote at a time
This commit was sponsored by Jack Hill on Patreon.
Diffstat (limited to 'Command')
-rw-r--r--Command/Export.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Command/Export.hs b/Command/Export.hs
index 22ea72170..a9f474a19 100644
--- a/Command/Export.hs
+++ b/Command/Export.hs
@@ -23,6 +23,7 @@ import Types.Remote
import Types.Export
import Annex.Content
import Annex.CatFile
+import Annex.LockFile
import Logs.Location
import Logs.Export
import Database.Export
@@ -85,7 +86,10 @@ seek o = do
r <- getParsed (exportRemote o)
unlessM (isExportSupported r) $
giveup "That remote does not support exports."
+ withExclusiveLock (gitAnnexExportLock (uuid r)) (seek' o r)
+seek' :: ExportOptions -> Remote -> CommandSeek
+seek' o r = do
new <- fromMaybe (giveup "unknown tree") <$>
-- Dereference the tree pointed to by the branch, commit,
-- or tag.