Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getReference error with 404 #29

Closed
iamsk opened this issue May 12, 2012 · 7 comments
Closed

getReference error with 404 #29

iamsk opened this issue May 12, 2012 · 7 comments

Comments

@iamsk
Copy link

iamsk commented May 12, 2012

I getAllReferences and return a list of references, i chose one ref, like this: refs/tags/master

when i used getReference, i got { message: '{"message":"Not Found"}', code: 404 }

any help, thanks

@iamsk iamsk closed this as completed May 12, 2012
@iamsk iamsk reopened this May 12, 2012
@iamsk
Copy link
Author

iamsk commented May 12, 2012

 *  - refs (String): Required. String of the name of the fully qualified reference (ie: refs/heads/master). If it doesn’t start with ‘refs’ and have at least two slashes, it will be rejected. 

I tested, this should be heads/master, not refs/heads/master, so, pls update this note.

@mikedeboer
Copy link

How strange!! The docs clearly state that the refs part is absolutely required: http://developer.github.com/v3/git/refs/ !

Do you have a reaction from the github devs that can make me feel sure that removing this from the docs is legit?

@iamsk
Copy link
Author

iamsk commented May 14, 2012

Maybe I didn't express clearly, I mean: when I set 'refs/heads/master' for key:ref, I opend the debug, and find: GET xxx/git/refs/refs/heads/master, I mean you have auto added refs in url or I make a fuss;)

@mikedeboer
Copy link

Ah! I see what you mean now... in the api/v3.0.0/routes.json file you can see the definition for this call:

        "get-reference": {
            "url": "/repos/:user/:repo/git/refs/:ref",
            "method": "GET",
            "params": {
                "$user": null,
                "$repo": null,
                "$ref": null
            }
        },

You can see that the url is formatted like /repos/:user/:repo/git/refs/:ref so if you remove refs from the url, it'll be fine. I will update the documentation, as it makes more sense to specify the Git root instead of making you prepend refs/ in front of it.

@mikedeboer
Copy link

or what do you think the best change to fix this should be? removing refs from the url in the definition or removing it from the documentation?

@iamsk
Copy link
Author

iamsk commented May 14, 2012

I think getReference(or other related) has expressed the meaning of refs, so as before, just update the doc will be ok:)

@mikedeboer
Copy link

fixed in the docs. thanks for reporting this!

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

No branches or pull requests

2 participants