Revert "feat(git): notify when not in a git repo instead of error (#2181)" (#2217)

This reverts commit a09df82861.
This commit is contained in:
Simon Hauser
2022-10-31 15:48:32 +01:00
committed by GitHub
parent 97847309cb
commit 4bd4205028

View File

@@ -392,11 +392,7 @@ local set_opts_cwd = function(opts)
local in_bare = utils.get_os_command_output({ "git", "rev-parse", "--is-bare-repository" }, opts.cwd) local in_bare = utils.get_os_command_output({ "git", "rev-parse", "--is-bare-repository" }, opts.cwd)
if in_worktree[1] ~= "true" and in_bare[1] ~= "true" then if in_worktree[1] ~= "true" and in_bare[1] ~= "true" then
utils.notify("builtin.git", { error(opts.cwd .. " is not a git directory")
msg = opts.cwd .. " is not a git directory",
level = "ERROR",
})
return false
elseif in_worktree[1] ~= "true" and in_bare[1] == "true" then elseif in_worktree[1] ~= "true" and in_bare[1] == "true" then
opts.is_bare = true opts.is_bare = true
end end
@@ -405,8 +401,6 @@ local set_opts_cwd = function(opts)
opts.cwd = git_root[1] opts.cwd = git_root[1]
end end
end end
return true
end end
local function apply_checks(mod) local function apply_checks(mod)
@@ -414,12 +408,10 @@ local function apply_checks(mod)
mod[k] = function(opts) mod[k] = function(opts)
opts = vim.F.if_nil(opts, {}) opts = vim.F.if_nil(opts, {})
local ok = set_opts_cwd(opts) set_opts_cwd(opts)
if ok then
v(opts) v(opts)
end end
end end
end
return mod return mod
end end