From 8ee32f0d8eb60a9791ef85e8233ee6e088c84d11 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 11 Jan 2021 21:41:39 +0100 Subject: [PATCH] Version control: Support for git worktrees. [DEVELOPMENT ENVIRONMENT] * NEW: Version control: Support for git worktrees. --- .../gambas3/.src/VersionControl/CVersionControlGit.class | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/gambas3/.src/VersionControl/CVersionControlGit.class b/app/src/gambas3/.src/VersionControl/CVersionControlGit.class index 51868a4be..aab344643 100644 --- a/app/src/gambas3/.src/VersionControl/CVersionControlGit.class +++ b/app/src/gambas3/.src/VersionControl/CVersionControlGit.class @@ -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