nuke icon indicating copy to clipboard operation
nuke copied to clipboard

Support for git worktrees

Open awinki opened this issue 1 year ago • 2 comments

Description

I use git worktrees a lot on my machine, but i can't use our nuke build script to build our solutions. I always get the following error:

Unhandled exception. System.ArgumentException: No parent Git directory for 'D:\Development'
   at Nuke.Common.Assert.NotNull[T](T obj, String message, String argumentExpression) in /_/source/Nuke.Utilities/Assert.cs:line 73
   at Nuke.Common.Git.GitRepository.FromLocalDirectory(AbsolutePath directory) in /_/source/Nuke.Build/VCS/GitRepository.cs:line 49

Instead of a ".git" folder there's just ".git" file, when working with git worktrees.

Usage Example

No response

Alternative

No response

Could you help with a pull-request?

No

awinki avatar May 21 '24 14:05 awinki

@matkoch

Our team uses worktrees extensively and I would love to contribute to this issue. Of course I know not to "push" a PR, and this may be non-trivial, so where is the best place to start? It seems that adding the following to the issue would be helpful to begin with:

  1. Expected behavior
  2. Observed behavior
  3. Steps to reproduce (Linux and Powershell)

Of course I don't have permission to update the issue itself. Should I document these things in a comment and then start working on a PR, or is a discussion in order for this issue before I begin?

@awinki if I write up a more filled out version of the issue template, will you update the issue?

ericburcham avatar Aug 20 '24 15:08 ericburcham

I have the same issue. To reproduce, simply create a worktree and run nuke script from the worktree folder. It is indeed because the .git is a file, not a folder.

nZeus avatar Aug 29 '24 07:08 nZeus