dpb56083 2015-07-29 17:33
浏览 134
已采纳

Gig2go:在远程上解压缩已发送的打包文件失败

I've struggled so much with this. I'm trying to push changes to the repo using the code below:

// Get remote
remote, err := repo.Remotes.Lookup("origin")
if err != nil {
    remote, err = repo.Remotes.Create("origin", repo.Path())
    if err != nil {
        return err
    }
}

// Get the branch
branch, err := repo.Branch()
if err != nil {
    return err
}

// Get the name
branchName, err := branch.Name()
if err != nil {
    return err
}

if err := remote.Push([]string{"refs/heads/"+branchName}, &git.PushOptions{}); err != nil {
    return err
}

Everything seems fine, but I keep getting this error:

unpacking the sent packfile failed on the remote

Upon reading a few git resources, I now understand what the error means, but I still have no idea what is causing it.


Edit

I have just tried using Git as per @Carlos' suggestion, and I'm am getting more information now:

git push --set-upstream origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 241 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To http://xxxxxxx/xxxxxx/app.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'http://xxxxxxx/xxxxxxx/app.git'

I thought I got the permissions right though, here is how my Git directory looks like on the server:

root@CodeSpaces-001:/home/git# ll
total 40
drwxr-xr-x 5 git  git  4096 Jul 29 19:22 ./
drwxr-xr-x 3 root root 4096 Jul 29 18:21 ../
drwxrwxr-x 3 git  git  4096 Jul 29 19:22 apps/ # My repos are in here

Should this not be sufficient?

  • 写回答

2条回答 默认 最新

  • dongye9071 2015-07-29 23:40
    关注

    This is an error, which happens on the server, so the place to look would be its logs. Have you tried doing the same operation with git itself? I don't remember off-hand, but there might be an extra error string which libgit2 is not returning at the moment.

    Errors to unpack on the server are often related to the permissions of the user which git is running on the remote.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题