Merge pull request #1348 from NeogitOrg/fix/do-not-allow-reset-when-detached-head

This commit is contained in:
Cameron 2024-05-31 22:54:26 +02:00 committed by GitHub
commit acdefce66f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,6 +167,11 @@ M.rename_branch = operation("rename_branch", function()
end)
M.reset_branch = operation("reset_branch", function(popup)
if not git.branch.current() then
notification.warn("Cannot reset with detached HEAD")
return
end
if git.status.is_dirty() then
if not input.get_permission("Uncommitted changes will be lost. Proceed?") then
return