diff --git a/src/wt/cmd/add.lua b/src/wt/cmd/add.lua index c1b3571aa5c520f8129690f70a55fef4fe1bb281..3097c369a0a212cceadeca70ca1c619c7c3a38c9 100644 --- a/src/wt/cmd/add.lua +++ b/src/wt/cmd/add.lua @@ -77,6 +77,7 @@ function M.cmd_add(args) .. existing_wt.path .. "\nhint: run `git worktree prune` to clean up stale entries" ) + return end wt_check:close() diff --git a/src/wt/cmd/clone.lua b/src/wt/cmd/clone.lua index de10ce1f71ee48e63e8daded3f208bc2797aeb93..86c972598871a5dbde586abdada31ed3ec03f708 100644 --- a/src/wt/cmd/clone.lua +++ b/src/wt/cmd/clone.lua @@ -26,6 +26,7 @@ function M.cmd_clone(args) local positional = {} while i <= #args do local a = args[i] + ---@cast a string if a == "--remote" then if not args[i + 1] then shell.die("--remote requires a name") diff --git a/src/wt/cmd/new.lua b/src/wt/cmd/new.lua index 57c3a8dd95878b603a2681fb739998e452cde95b..bd0e5156306d574529c4e1219ffe08783ea3ebed 100644 --- a/src/wt/cmd/new.lua +++ b/src/wt/cmd/new.lua @@ -25,6 +25,7 @@ function M.cmd_new(args) local positional = {} while i <= #args do local a = args[i] + ---@cast a string if a == "--remote" then if not args[i + 1] then shell.die("--remote requires a name")