Version control: Support for git worktrees.

[DEVELOPMENT ENVIRONMENT]
* NEW: Version control: Support for git worktrees.
This commit is contained in:
gambas 2021-01-11 21:41:39 +01:00
parent f3dd4b5dcd
commit 8ee32f0d8e

View file

@ -37,10 +37,17 @@ End
Private Sub FindRoot() As String
Dim sDir As String
Dim sPath As String
Dim sData As String
sDir = Project.Dir
While Len(sDir) > 1
If Exist(sDir &/ ".git/HEAD") Then Return sDir
sPath = sDir &/ ".git"
If Exist(sPath) Then
If Exist(sPath &/ "HEAD") Then Return sDir
Try sData = File.Load(sPath)
If sData Begins "gitdir:" Then Return sDir
Endif
sDir = File.Dir(sDir)
Wend