Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As I described in #1512 (comment), this makes it so that local plugins will only show as needing updates if the local branch is behind the upstream branch. This is done by checking the output of the
git log
command, and only settingplugin._.updates
if the output is not empty.This seems to solve my issue where local plugins with unpushed changes always show as needing updates, but if there's a easier/better way of doing it then please feel free to edit/close this. Or if you don't agree that the current behaviour is a bug, then that's also fine - it's not a big deal and I can easily just ignore the "updates available" notice.
I also came across a minor issue where the plugin diff view (press
d
) compares the wrong commits for local plugins, because lua/lazy/view/init.lua always usesget_target
. I fixed this by movingget_local_target
intoget_target
- I think this is simpler and more straightforward than the alternative of adding a ternary everywhereget_target
is called.This second bugfix is a very small change, so I've just included it here, but I'm happy to make a second PR if you'd like.
Related Issue(s)
Related PR: #1512