Git receive/update hooks and new branches

前端 未结 4 887
一生所求
一生所求 2020-12-05 17:28

I have a problem with the \'update\' hook. In the case of a new branch, it gets a 0000000000000000000000000000000000000000 as the \'oldrev\'. And I don\'t know how to handle

4条回答
  •  情书的邮戳
    2020-12-05 17:56

    I solved this for my update hook using the following:

    if [ "$oldrev" -eq 0 ]; then
    git log "$(git show-branch --merge-base)".."$newrev"; else
    foo;
    fi
    

提交回复
热议问题