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

想請教nodegit的問題,在gitlab上面有錯誤訊息,推commit推不上去 #15

Open
michael34435 opened this issue Nov 19, 2016 · 1 comment

Comments

@michael34435
Copy link

michael34435 commented Nov 19, 2016

目的

我希望用nodegit做cherry-pick工具

使用的工具

macOS 10.12.1
node.js 7.1.0 --harmony-async-await
nodegit 0.16.0

操作流程

透過nodegit的cherry-pick功能成功建立了commit,並且送到remote端做push的動作

嘗試過的解法

嘗試用connect先連線但是還是沒有效果

程式碼

程式碼

const repo = await Git.Repository.open(process.cwd())
const remote = await repo.getRemote('origin')
const current = await repo.getCurrentBranch()
await remote.push(
  [`${current.name()}:${current.name()}`],
  {
    callbacks: {
      certificateCheck: () => 1,
      credentials: (url) => {
        if (url.indexOf('http') === -1) {
          return Git.Cred.sshKeyFromAgent(USERNAME)
        } else {
          return Git.Cred.userpassPlaintextNew(USERNAME, PASSWORD)
        }
      }
    }
  }
)

錯誤

Error: Unexpected HTTP status code: 411
@michael34435 michael34435 changed the title 想請教nodegit的問題,在gitlab上面有錯誤訊息推commit推不上去 想請教nodegit的問題,在gitlab上面有錯誤訊息,推commit推不上去 Nov 19, 2016
@michael34435
Copy link
Author

問題看來已經確定了,目前是判斷說nodegit那裡只要碰到http protocol就會reject

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

1 participant