-
-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug fix: assert because M.version is nil #960
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
@@ -88,7 +88,8 @@ end | |||
--- @return boolean | |||
local function check_version(version) | |||
if not M.version then | |||
return false | |||
M._set_version(config._git_version) | |||
return check_version(version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this line is necessary. Once the version is set the rest of the function should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin functions properly once the M.version is loaded. However, the persistent assert messages that appear every time files are loaded are bothersome. I would appreciate it if the assert statement in get_repo_info could be eliminated.
Fixed a bug related to version checking before the version was established.
This issue likely arose due to the asynchronous nature of gitsigns operations. By adding logging for the check_version and _set_version functions, I observed the following behavior:
However, an error occurred when checking the version again due to an attempt to access a non-existent .git directory, causing a failure in the coroutine.
Bellow is the logs I capture
This issue appears to be sporadic and not consistently reproducible for a couple of reasons:
nvim
, but my working directory isnvim/lua/plugin
. If the version has not yet been set, Lua asserts an error due to the absence of the.git
directory in the working folder.