Skip to content

Commit e7ae437

Browse files
committed
* https://github.com/prati0100/git-gui: git-gui: allow opening work trees from the startup dialog
2 parents ae46588 + 469725c commit e7ae437

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

git-gui/lib/choose_repository.tcl

+3-24
Original file line numberDiff line numberDiff line change
@@ -357,31 +357,10 @@ proc _is_git {path {outdir_var ""}} {
357357
if {$outdir_var ne ""} {
358358
upvar 1 $outdir_var outdir
359359
}
360-
if {[file isfile $path]} {
361-
set fp [open $path r]
362-
gets $fp line
363-
close $fp
364-
if {[regexp "^gitdir: (.+)$" $line line link_target]} {
365-
set path [file join [file dirname $path] $link_target]
366-
set path [file normalize $path]
367-
}
368-
}
369-
370-
if {[file exists [file join $path HEAD]]
371-
&& [file exists [file join $path objects]]
372-
&& [file exists [file join $path config]]} {
373-
set outdir $path
374-
return 1
375-
}
376-
if {[is_Cygwin]} {
377-
if {[file exists [file join $path HEAD]]
378-
&& [file exists [file join $path objects.lnk]]
379-
&& [file exists [file join $path config.lnk]]} {
380-
set outdir $path
381-
return 1
382-
}
360+
if {[catch {set outdir [git rev-parse --resolve-git-dir $path]}]} {
361+
return 0
383362
}
384-
return 0
363+
return 1
385364
}
386365

387366
proc _objdir {path} {

0 commit comments

Comments
 (0)