You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's even weirder is that if I do a lookup before running repo.config.each_key, the cache seems to get flushed. This returns the right result for 0.28.0:
require'rugged'repo=Rugged::Repository.new('.')start_values=repo.config.each_key.to_asystem('git config --local core.foobar "asdf"')# Do a lookup before each_key is calledputs"Inserted value: #{repo.config['core.foobar']}"new_values=repo.config.each_key.to_asystem('git config --local --unset core.foobar')putsstart_values == new_values
tigefa4u
pushed a commit
to tigefa4u/gitlabhq
that referenced
this issue
Mar 19, 2019
This version bump makes things consistent between Gitaly and
fixes a significant number of bugs:
https://github.com/libgit2/libgit2/releases
This also decreases disk space of Omnibus builds by ~30 MB.
There is also a workaround for
libgit2/rugged#785. If Gitaly or another
process changes .gitconfig while Rugged has the file loaded,
Rugged::Repository#each_key will report stale values unless a lookup is
done first.
This bug only manifests in a spec because we are using both Gitaly and
Rugged at the same time there, and we normally don't use Rugged in the
CE/EE code in this way.
This looks like a regression from libgit2 0.28.0, but I'm not sure yet if it's a Rugged issue or a libgit2 one. Here's a sample reproduction:
With Rugged 0.27.5, I get:
Inserted value: asdf false
With Rugged 0.28.0, I get:
Inserted value: asdf true
What's curious is that the lookup works fine, but the
each_key
seems to be cached in the 0.28.0 case.@pks-t @carlosmn I think this has to do with the in-memory config backend in libgit2/libgit2#4767.
The text was updated successfully, but these errors were encountered: