Copy Oids that we get from the UpdateTipsCallback after a fetch
This is an attempt to fix where we're trying to find
commits from other repositories. We suspect that this is due to libgit2
reusing the same memory location for Oids in a loop.
@@ -132,7 +132,7 @@ func (c *client) Fetch(repositoryPath string) (map[string][]*git.Oid, error) {
changes := map[string][]*git.Oid{}
updateTipsCallback := func(refname string, a *git.Oid, b *git.Oid) git.ErrorCode {
- changes[refname] = []*git.Oid{a, b}
+ changes[refname] = []*git.Oid{a.Copy(), b.Copy()}
return 0
}
