diff options
author | 2015-03-06 11:21:52 -0500 | |
---|---|---|
committer | 2015-03-07 12:28:58 +0000 | |
commit | cc6825e194c86382068548354faa43839410a8d3 (patch) | |
tree | 60bfbd68258c484be5e05751cd686691120601db | |
parent | git-gui: reinstate support for Tcl 8.4 (diff) | |
download | tgif-cc6825e194c86382068548354faa43839410a8d3.tar.xz |
git-gui: Fixes chooser not accepting gitfiles
Support the case where .git is a platform independent symbolic link
and not a directory. This occurs when --separate-git-dir is used when
creating the local repository to store the .git directory elsewhere.
git-gui does not support such repositories when using the repository
chooser as the test to determine that the chosen directory is a git
repository fails for such repositories.
This commit enables _is_git to read the real location from the
symbolic link file.
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Remi Rampin <remirampin@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rw-r--r-- | lib/choose_repository.tcl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl index 92d602221f..abc6b1dbcb 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]]} { |