summaryrefslogtreecommitdiff
path: root/git-gui/lib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-20 19:04:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-20 19:04:06 (GMT)
commite7ae437ac19eb0e82739d82cc886221252689ff4 (patch)
treebaed7059dcb8ad2e61de4041debdbfeda85ec697 /git-gui/lib
parentae46588be0cd730430dded4491246dfb4eac5557 (diff)
parent469725c1a3d44f7e1475f1d37cd13e0824d4ea41 (diff)
downloadgit-e7ae437ac19eb0e82739d82cc886221252689ff4.zip
git-e7ae437ac19eb0e82739d82cc886221252689ff4.tar.gz
git-e7ae437ac19eb0e82739d82cc886221252689ff4.tar.bz2
Merge https://github.com/prati0100/git-gui into master
* https://github.com/prati0100/git-gui: git-gui: allow opening work trees from the startup dialog
Diffstat (limited to 'git-gui/lib')
-rw-r--r--git-gui/lib/choose_repository.tcl27
1 files changed, 3 insertions, 24 deletions
diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl
index e54f3e6..af1fee7 100644
--- a/git-gui/lib/choose_repository.tcl
+++ b/git-gui/lib/choose_repository.tcl
@@ -357,31 +357,10 @@ proc _is_git {path {outdir_var ""}} {
if {$outdir_var ne ""} {
upvar 1 $outdir_var outdir
}
- 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]]} {
- set outdir $path
- return 1
- }
- if {[is_Cygwin]} {
- if {[file exists [file join $path HEAD]]
- && [file exists [file join $path objects.lnk]]
- && [file exists [file join $path config.lnk]]} {
- set outdir $path
- return 1
- }
+ if {[catch {set outdir [git rev-parse --resolve-git-dir $path]}]} {
+ return 0
}
- return 0
+ return 1
}
proc _objdir {path} {