0
我正在写一个git远程的预接收钩。如果推送中的任何改变的对象被破坏(即悬挂)符号链接,则该预接收钩应拒绝推送。Git预接收钩拒绝推断与破碎的符号链接
也就是说,
#!/bin/bash
# hooks/pre-receive
while read old_sha1 new_sha1 name ; do
files=$(git diff --name-only $old_sha1..$new_sha1)
# If a file in $files is a symbolic link pointing at nothing, non-zero exit
done
我怎样才能做到这一点?
预接收钩子运行在远程git仓库上,这是一个“裸”的仓库。裸存储库没有存储库的工作副本,也没有常用目录布局中的任何工作副本文件。因此,上述不起作用。 – rlandster