From: Tobias Ulmer Date: Tue, 18 Sep 2018 17:55:01 +0000 (+0200) Subject: fetch-project: enforce mutual exclusivness of --tag and --branch X-Git-Tag: e2factory-2.3.18rc1~74 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=eaaee1fbd20fd90bc34b75414292ba751a610df1;p=e2factory.git fetch-project: enforce mutual exclusivness of --tag and --branch Signed-off-by: Tobias Ulmer --- diff --git a/global/e2-fetch-project.lua b/global/e2-fetch-project.lua index 012ac66..a8be637 100644 --- a/global/e2-fetch-project.lua +++ b/global/e2-fetch-project.lua @@ -76,6 +76,10 @@ local function e2_fetch_project(arg) error(err.new("too many arguments")) end + if opts["tag"] and opts["branch"] then + error(err.new("--tag and --branch are mutually exclusive")) + end + local sl, re = e2lib.parse_server_location(arguments[1], e2lib.globals.default_projects_server) if not sl then @@ -104,13 +108,8 @@ local function e2_fetch_project(arg) if opts["branch"] then p.branch = opts["branch"] - else - p.branch = nil - end - if opts["tag"] then + elseif opts["tag"] then p.tag = opts["tag"] - else - p.tag = nil end -- fetch project descriptor file