summaryrefslogtreecommitdiff
path: root/vc-dwim-find-git-worktree.patch
blob: bd0cdeee990519574437b78132de1d8a037c16f3 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From fb361218cdbceb8acaffa7f7049c41e1e892ca6e Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Thu, 1 Feb 2018 10:25:00 +0300
Subject: [PATCH] maint: find git worktree

* VC.pm (new): Find .git file instead of directory.
---
 VC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/VC.pm b/VC.pm
index 4252c61..1eca5b8 100644
--- a/VC.pm
+++ b/VC.pm
@@ -132,7 +132,7 @@ sub new($%)
 	  }
 	}
 
-      if (-d "$d/.git/objects") {
+      if ((-d "$d/.git/objects") || (-f "$d/.git")) {
 	$self->{name} = GIT;
       } elsif (-d "$d/.bzr/repository") {
 	$self->{name} = BZR;
-- 
2.15.1