summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 16:18:04 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2015-11-05 16:18:04 +0000
commit2320a33f4f07498e08f2d37b4276ad75599b93d5 (patch)
tree403c015718b9b501239f77035c406df40cdc473e
parent7d3790a7e0bb5ad3e496735292a92e43af63e2fc (diff)
downloadgitano-2320a33f4f07498e08f2d37b4276ad75599b93d5.tar.bz2
Ensure you can write before copy is permitted to proceed
-rw-r--r--lib/gitano/copycommand.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitano/copycommand.lua b/lib/gitano/copycommand.lua
index 86749a4..6645dd2 100644
--- a/lib/gitano/copycommand.lua
+++ b/lib/gitano/copycommand.lua
@@ -59,7 +59,14 @@ local function builtin_copy_prep(config, srcrepo, cmdline, context)
if action ~= "allow" then
return action, reason
end
- -- Able to read and create, thus can copy
+ -- Check 3, target repository can be written to
+ ctx = util.deep_copy(context)
+ ctx.operation = "write"
+ action, reason = cmdline.tgtrepo:run_lace(ctx)
+ if action ~= "allow" then
+ return action, reason
+ end
+ -- Able to read, create, and write; thus can copy
return "allow", "Passed all checks, can copy"
end