git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Running 'git worktree add' in 'pre-commit' hook
@ 2019-05-14 14:52 Cosmin Polifronie
  2019-05-15  0:46 ` Bryan Turner
  2019-05-16 11:25 ` Duy Nguyen
  0 siblings, 2 replies; 17+ messages in thread
From: Cosmin Polifronie @ 2019-05-14 14:52 UTC (permalink / raw)
  To: git

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! :)

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-05-17  1:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14 14:52 Running 'git worktree add' in 'pre-commit' hook Cosmin Polifronie
2019-05-15  0:46 ` Bryan Turner
2019-05-15 12:38   ` Cosmin Polifronie
2019-05-16 11:25 ` Duy Nguyen
2019-05-16 11:33   ` Eric Sunshine
2019-05-16 11:39     ` Eric Sunshine
2019-05-16 11:44       ` Duy Nguyen
2019-05-16 12:05         ` Eric Sunshine
2019-05-16 11:41     ` Duy Nguyen
2019-05-16 12:14       ` Eric Sunshine
2019-05-16 12:28         ` Duy Nguyen
2019-05-16 11:59   ` Eric Sunshine
2019-05-16 22:17   ` Jeff King
2019-05-16 23:16     ` Eric Sunshine
2019-05-17  0:19       ` Jeff King
2019-05-17  1:02         ` Eric Sunshine
2019-05-17  1:19           ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).