Closed kcamp closed 1 year ago
If you call GitFindRootFromPath("./") from a path where no ancestor contains a valid Git repository, the method will loop forever.
GitFindRootFromPath("./")
Repro Create a folder where a valid git repository is not accessible - i.e., c:\git\repro and add this cake script.
c:\git\repro
#addin "nuget:?package=Cake.Git&version=0.22" Task("Default") .Does(() => { Information("Finding git root"); GitFindRootFromPath(MakeAbsolute(new DirectoryPath("."))); }); RunTarget("Default");
The task will get caught in the do..while loop and loop forever.
do..while
https://github.com/cake-contrib/Cake_Git/blob/63ee1c9219527e86cb7488922c85645542ac1b76/src/Cake.Git/GitAliases.Repository.cs#L192-L201
We need to add a termination condition to the loop and allow the exception to be thrown.
Closed in #128
If you call
GitFindRootFromPath("./")
from a path where no ancestor contains a valid Git repository, the method will loop forever.Repro Create a folder where a valid git repository is not accessible - i.e.,
c:\git\repro
and add this cake script.The task will get caught in the
do..while
loop and loop forever.https://github.com/cake-contrib/Cake_Git/blob/63ee1c9219527e86cb7488922c85645542ac1b76/src/Cake.Git/GitAliases.Repository.cs#L192-L201
We need to add a termination condition to the loop and allow the exception to be thrown.