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条)

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统