Skip to content
Snippets Groups Projects
Commit d326d342 authored by Stan Hu's avatar Stan Hu
Browse files

Optimize branch lookups and force a repository reload for Repository#find_branch

If `git gc` runs and `Repository` has an instance to `Rugged::Repository`, a
bug in libgit2 may cause the instance to return a stale value or a missing
branch. This change not only optimizes the branch lookup so we don't have
to iterate through every branch, but it also works around the `git gc`
issue by forcing a repository reload every time `Repository#find_branch`
is called.

See: https://github.com/libgit2/libgit2/issues/1534

Closes #15392, #21470
parent 1c4e8663
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment