+
Skip to content

Bug with Repo.write() in 0.10 #167

Closed
@nicolas-van

Description

@nicolas-van

I reproduced the following bug with version 0.10.2 and 0.10.3 but it worked fine in 0.9.2 (all under Chrome 40).

Here is the code:

var github = new Github({
    username: "nicolas-van",
    password: 'thepassword',
    auth: "basic",
});

var repo = github.getRepo("nicolas-van", "githubapitest");
repo.write("gh-pages", "test.html", 'hello', '', function(err, res) {
    debugger;
});

This code works fine if test.html doesn't exist yet, but crashes with a strange error if it already exists:

 Uncaught SyntaxError: Unexpected token e

I must precise that, in my test, test.html is a simple text file containing the word "test".

Bu debugging a little I also saw that it's not really the method write() that causes problem but the method getSha() (which is called at the beginning of the write() method).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载