summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-10-12 20:33:45 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-10-13 03:07:59 (GMT)
commit82dd4e0465282e39962ba8fdb01c42aa665b1999 (patch)
tree31b3739cb07b55ac976cae9d387b1650d14d1ce2
parentba6c761e6287f9987d70ed4d2a609a7ed415a6a5 (diff)
downloadgit-82dd4e0465282e39962ba8fdb01c42aa665b1999.zip
git-82dd4e0465282e39962ba8fdb01c42aa665b1999.tar.gz
git-82dd4e0465282e39962ba8fdb01c42aa665b1999.tar.bz2
git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows
Apparently native Tcl/Tk on Windows is using \ as the return value from [file separator] but [file normalize] on that same system is using / rather than \ to represent a directory separator. I really think that is nuts, but its what is happening. So we can actually just hardcode our separator to / as all systems we support (Windows, Mac OS X, UNIX) use /. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--lib/choose_repository.tcl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl
index bf04361..2bac50e 100644
--- a/lib/choose_repository.tcl
+++ b/lib/choose_repository.tcl
@@ -140,12 +140,16 @@ constructor pick {} {
$w_recentlist tag conf link \
-foreground blue \
-underline 1
- set home "[file normalize $::env(HOME)][file separator]"
+ set home $::env(HOME)
+ if {[is_Cygwin]} {
+ set home [exec cygpath --windows --absolute $home]
+ }
+ set home "[file normalize $home]/"
set hlen [string length $home]
foreach p $sorted_recent {
set path $p
if {[string equal -length $hlen $home $p]} {
- set p "~[file separator][string range $p $hlen end]"
+ set p "~/[string range $p $hlen end]"
}
regsub -all "\n" $p "\\n" p
$w_recentlist insert end $p link