Re: Bug: 'git ls-files' doesn't work on submodule in post-commit hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-02-24 at 07:03:15, Stefan wrote:
> So 'git ls-files' call in post-checkout hook works:
> $ git checkout HEAD
> A       .gitmodules
> A       git-submodulerepo
> Git says my files are:
> submodule_file.txt
> ---------------
> Filesystem says my files are:
> submodule_file.txt
> ---------------
>  
> A 'git ls-files' in post-commit doesn’t work:
> $  echo nothing >> rubbish.txt && git commit rubbish.txt -m "Add just rubbish"
> Git says my files are:
> ---------------
> Filesystem says my files are:
> submodule_file.txt
> ---------------
> [master e05efb1] just rubbish
> 1 file changed, 1 insertion(+)

Can you check to see if the GIT_DIR environment variable is set in your
hook?  In some cases, Git sets various GIT_* environment variables when
calling a hook or command, and if you want another repository, you'd
need to unset those values.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux