Running 'git worktree add' in 'pre-commit' hook

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

 



Hello! I am trying to run 'git worktree add <path> HEAD' in the
'pre-commit' hook, more specifically in a Python script that is being
called from the hook. When doing so, I am greeted with the following
error:

On Windows 10:
Preparing worktree (detached HEAD cbfef18)
fatal: Unable to create 'C:/Users/meh/Desktop/abc/.git/index.lock': No
such file or directory

On Arch Linux:
Preparing worktree (detached HEAD cbfef18)
fatal: Unable to create '/home/cosmin/Downloads/abc/.git/index.lock':
Not a directory

Is it forbidden to call this command from a hook? If yes, what kind of
alternatives do I have? I need to make a copy of the repo in its HEAD
state, process it and then decide if I will pass the current commit or
not.

Thanks! :)



[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