Skip to content

Commit bf0ac32

Browse files
committed
git-gui: add support for filenames starting with tilde
prevent TCL from doing tilde expansion on literal filenames. This fixes git-for-windows/git#4349 Signed-off-by: Matthias Aßhauer <[email protected]>
1 parent a5005de commit bf0ac32

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

git-gui.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,6 +2338,7 @@ proc do_explore {} {
23382338
# Open file relative to the working tree by the default associated app.
23392339
proc do_file_open {file} {
23402340
global _gitworktree
2341+
if {[string index $file 0] eq {~}} {set file ./$file}
23412342
set explorer [get_explorer]
23422343
set full_file_path [file join $_gitworktree $file]
23432344
exec $explorer [file nativename $full_file_path] &

lib/diff.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ proc show_other_diff {path w m cont_info} {
190190
set max_sz 100000
191191
set type unknown
192192
if {[catch {
193+
if {[string index $path 0] eq {~}} {set path ./$path}
193194
set type [file type $path]
194195
switch -- $type {
195196
directory {

lib/index.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ proc delete_helper {path_list path_index deletion_errors batch_size \
617617

618618
set path [lindex $path_list $path_index]
619619

620-
set deletion_failed [catch {file delete -- $path} deletion_error]
620+
set deletion_failed [catch {file delete -- ./$path} deletion_error]
621621

622622
if {$deletion_failed} {
623623
lappend deletion_errors [list "$deletion_error"]

0 commit comments

Comments
 (0)