Makes _is_git handle the case where the path is a "gitdir: ..." file.
---
 lib/choose_repository.tcl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl
index 92d6022..abc6b1d 100644
--- a/lib/choose_repository.tcl
+++ b/lib/choose_repository.tcl
@@ -339,6 +339,16 @@ method _git_init {} {
 }
 
 proc _is_git {path} {
+       if {[file isfile $path]} {
+               set fp [open $path r]
+               gets $fp line
+               close $fp
+               if {[regexp "^gitdir: (.+)$" $line line link_target]} {
+                       set path [file join [file dirname $path] $link_target]
+                       set path [file normalize $path]
+               }
+       }
+
        if {[file exists [file join $path HEAD]]
         && [file exists [file join $path objects]]
         && [file exists [file join $path config]]} {
-- 
1.9.5.msysgit.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to