Split the OID lookup from the object lookup in GTEnumerator#590
Split the OID lookup from the object lookup in GTEnumerator#590pietbrauer merged 3 commits intolibgit2:masterfrom
Conversation
|
I would like a second pair of eyes on that one. IMHO it's a small change, and it allows us to not-unexpectedly-fail when working against shallow repositories. |
ObjectiveGit/GTRepository.m
Outdated
| git_oid_tostr(oid_str, sizeof(oid_str), oid); | ||
| *error = [NSError git_errorFor:gitError description:@"Failed to lookup object %s in repository.", oid_str]; | ||
| *error = [NSError git_errorFor:gitError | ||
| description:@"Failed to lookup object" |
There was a problem hiding this comment.
It actually looks fine in Xcode, I've checked. I'd say GitHub gets confused because Holy Wars™ 😉 .
There was a problem hiding this comment.
You sure, Xcode is fine with mixing tabs and spaces, Git is not.
There was a problem hiding this comment.
Here's what I see in Xcode (TextMate show the same thing) : https://www.dropbox.com/s/wb3zu4xl3dss0v8/Capture%20d%27%C3%A9cran%202016-10-26%2015.31.21.PNG?dl=0
GH's Obj-C styleguide doesn't really help in that regard. A quick fix would be to disallow newline-in-selectors, which would make the align-colons-in-selectors point moot. But that line would get gigantic...
There was a problem hiding this comment.
Arguably, I'm breaking the styleguide by using spaces to align colons. So there's that too...
There was a problem hiding this comment.
You are right. Please remove the multi line error and make it one line. I looked up the other usages of this error method and it is a one liner everywhere. #StickingToTheStyleGuide
#FollowTheStyleGuide
|
Fixed styling. I'll keep my fingers crossed that Travis doesn't hate me... |
This is a first step toward handling shallow repositories, by separating the lookup done while enumerating.
Also provides the missing OID through the error.
Related to libgit2/libgit2#3058