Subject: bug#30316: [PATCH] maint: find git worktree

From: Oleg Pykhalov <[email-masked]>
Date: Thu, 01 Feb 2018 11:45:17 +0300

In addion to my previous message.

Oleg Pykhalov <[email-masked]> writes:

> The following patch allows to use 'vc-chlog' in the Git worktree instead
> of getting “can't determine version control system for DIRECTORY”.

Probably a directory is needed, too.  I was little bit confused about
that directory is a file and it worked for the first time because I have
another version of vc-dwim installed simultaneously.  Apologies.

Here is a new patch.

From 3b0774898a7b5a60e4bd71ae1306d285b7d23ba6 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <[email-masked]>
Date: Thu, 1 Feb 2018 10:25:00 +0300
Subject: [PATCH] maint: find git worktree

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

diff --git a/VC.pm b/VC.pm
index 4252c61..9254c96 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

Thanks,
Oleg.