cscheid / rgithub

R bindings for the github API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create.repository() problems

jnmaloof opened this issue · comments

It is possible that I am not understanding something, but I am having problems with create.repository():

based on the help file I thought that I should run it like this:

create.repository(name="my_new_repo",ctx)

But I get an error

Error: is.null(body) is not TRUE

Same error if I try

create.repository2(content=list(name="my_new_repos"),ctx=ctx)

However I can fix it by modifying the function:

create.repository2 <- function (content, ctx = get.github.context()) 
.api.post.request(ctx, c("user", "repos"), body = content)

environment(create.repository2) <- asNamespace("github")

create.repository2(content=list(name="my_new_repos"),ctx=ctx)
#works!

(original function is):

function (..., ctx = get.github.context()) 
.api.post.request(ctx, c("user", "repos"), body = content)

Is there something I don't understand about how to use the original function, or is this a bug?

Thanks,

Julin

ps

> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] github_0.9.6

loaded via a namespace (and not attached):
 [1] bitops_1.0-6    brew_1.0-6      httr_0.6.1      jsonlite_0.9.14 mime_0.2        RCurl_1.95-4.5  rjson_0.2.15    Rook_1.1-1     
 [9] stringr_0.6.2   tools_3.1.2    

It's an embarrassing bug; create.repository appears to be completely broken on master. Thanks for catching that.

Incidentally, it's not easy to test create.repository (and other similar things) without polluting someone's GitHub's profile. I honestly don't know what the best practice here should be.