Skip to content

Commit 7433fa0

Browse files
committed
fix: post warning when attempting to call non-existing command
1 parent cba0eff commit 7433fa0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/tinygit/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ setmetatable(M, {
4141
end
4242

4343
local module = M.cmdToModuleMap[key]
44+
if not module then
45+
u.notify(("Unknown command `%s`."):format(key), "warn")
46+
return function() end -- prevent function call throwing error
47+
end
4448
require("tinygit.commands." .. module)[key](...)
4549
end
4650
end,

0 commit comments

Comments
 (0)