Skip to content

Conversation

@alanjrogers
Copy link
Contributor

After publishing a new branch I noticed that -trackingBranchWithError: success: was still returning a nil, after a bit of investigation it turns out libgit2 was using a stale version of the repo's config when it was looking up the branch.*.remote and branch.*.merge in git_branch_upstream_name.

So I've added a [configuration refresh:] call before we call git_branch_upstream.

@carlosmn
Copy link
Member

This shouldn't be needed. If it does fix it, it would point out a bug in libgit2's snapshotting.

@alanjrogers
Copy link
Contributor Author

@carlosmn it is needed. In my tests, the config is stale after first publishing a local branch (via git.git. I'll look into the libgit2 confit snapshotting code tomorrow.

@jspahrsummers
Copy link
Contributor

@alanjrogers This looks good to me. Do you want me to wait to merge it until you've had a chance to look at libgit2?

@jspahrsummers jspahrsummers self-assigned this Oct 15, 2014
@alanjrogers
Copy link
Contributor Author

@jspahrsummers yup, thanks.

@alanjrogers
Copy link
Contributor Author

Ok, I've attempted to make this fix in libgit2 instead. This PR is now dependent on libgit2/libgit2#2620.

@joshaber
Copy link
Member

🤘

@alanjrogers
Copy link
Contributor Author

Now depends on libgit2/libgit2#2622 :trollface:.

@alanjrogers alanjrogers changed the title Refresh git configuration before looking for the tracking branch. [WIP] Refresh git configuration before looking for the tracking branch. Oct 21, 2014
@alanjrogers
Copy link
Contributor Author

Marking this as [WIP] until we've resolved the issues we're encountering using this branch in GHfM.

@alanjrogers
Copy link
Contributor Author

libgit2 master seems to resolve the issue, once the libgit2 dependency is merged I'll bump the submodule to libgit2 master and we should be good to go.

@alanjrogers
Copy link
Contributor Author

This should be good to go. The tests are failing because the CI machine is now running Xcode 6.1 😢

@alanjrogers alanjrogers changed the title [WIP] Refresh git configuration before looking for the tracking branch. Refresh git configuration before looking for the tracking branch. Oct 23, 2014
Copy link
Contributor

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 __block is necessary, since it'll only be captured in @onExit after receiving a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler says no. Looks like it captures a const reference in the block. Although I could cast that error away, but at that point I'd prefer to use the __block qualifier.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. 👍

@jspahrsummers
Copy link
Contributor

jspahrsummers added a commit that referenced this pull request Oct 23, 2014
Refresh git configuration before looking for the tracking branch.
@jspahrsummers jspahrsummers merged commit 4f47bdc into master Oct 23, 2014
@jspahrsummers jspahrsummers deleted the fix-tracking-branch branch October 23, 2014 22:03
@jspahrsummers jspahrsummers removed their assignment May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants