带有git-lfs的git pull失败,并在合并后挂钩中出现“数值结果超出范围”

时间:2019-06-18 21:03:35

标签: git-lfs

我正在检出配置为使用git lfs的git存储库,并带有“ git pull”,并从 git / hooks /中收到错误“ 数值结果超出范围”结帐后步骤。

出现错误后,存储库似乎已完成。重复调用 git pull 是没有错误的。 git lfs fetch 也已完成,没有错误。

我的环境是:

$ uname -a
Linux ubuntu 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

后端服务器是:

GitHub Enterprise Server 2.16.10

git-lfs是最新版本:

git-lfs/2.7.2 (GitHub; linux amd64; go 1.12.4; git 08a08ae0)

git:

git version 2.17.1

合并后的钩子是标准的,不能被操纵:

$ /.git/hooks> cat post-merge
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use G
it LFS, remove this hook by deleting .git/hooks/post-merge.\n"; exit 2; }
git lfs post-merge "$@"

存储库不是特别大:大约只有2.0G。最大文件约为162M:

162094612       ./file

Git克隆输出:

(base) $ git clone https://xx/xxx/xxx.git
Cloning into 'xxx'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 454 (delta 2), reused 11 (delta 2), pack-reused 440
Receiving objects: 100% (454/454), 3.69 MiB | 3.09 MiB/s, done.
Resolving deltas: 100% (105/105), done.
Checking out files: 100% (406/406), done.
Filtering content: 100% (79/79), 989.66 MiB | 3.75 MiB/s, done.
fatal: cannot exec '.git/hooks/post-checkout': Numerical result out of range

配置正确:

$ git config -l
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
...

运行带有跟踪的git pull显示可能的犯罪者是libodbcHDB.a,它不是特别大:

22:44:07.564109 trace git-lfs: filepathfilter: accepting "hdbclient/libodbcHDB.a"
Filtering content: 100% (79/79), 989.66 MiB | 3.88 MiB/s, done.
22:44:41.406236 run-command.c:646       trace: run_command: .git/hooks/post-checkout 0000000000000000000000000000000000000000 da48430be27b4538592bfa6129bc60774e27d1a8 1
fatal: cannot exec '.git/hooks/post-checkout': Numerical result out of range
22:44:41.416862 run-command.c:46        trace: run_command: running exit handler for pid 21945
22:44:41.426946 trace git-lfs: filepathfilter: rewrite ".git" as "**/.git/**"
22:44:41.427090 trace git-lfs: filepathfilter: rewrite "**/.git" as "**/.git"
22:44:41.433243 trace git-lfs: filepathfilter: accepting "tmp"

$ ls -l hdbclient/libodbcHDB.a
-rw-rw-r--. 1 xxx xxx 162094612 Jun 18 22:44 hdbclient/libodbcHDB.a

https://github.com/git-lfs/git-lfs/issues上没有任何问题。

重复的git pull完成没有错误:

$ git pull
Already up to date.

我在https://github.com/git-lfs/git-lfs/blob/master/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go的git-lfs源中找到了相关的常量

{34, "ERANGE", "numerical result out of range"},
    ERANGE          = syscall.Errno(0x22)

但是它并不能帮助我理解错误。 Google和git-lfs上的问题对此错误一无所知。 我期望对存储库进行无错检出。

除了删除(可能是有问题的)文件之外,我还能做些什么来修复它?

0 个答案:

没有答案