Merge branch 'maint'
* maint: git-gui: Trim trailing slashes from untracked submodule names git-gui: Assume untracked directories are Git submodules git-gui: handle "deleted symlink" diff marker git-gui: show unstaged symlinks in diff viewer
This commit is contained in:
commit
5f51ccd259
@ -1029,7 +1029,11 @@ proc read_ls_others {fd after} {
|
|||||||
set pck [split $buf_rlo "\0"]
|
set pck [split $buf_rlo "\0"]
|
||||||
set buf_rlo [lindex $pck end]
|
set buf_rlo [lindex $pck end]
|
||||||
foreach p [lrange $pck 0 end-1] {
|
foreach p [lrange $pck 0 end-1] {
|
||||||
merge_state [encoding convertfrom $p] ?O
|
set p [encoding convertfrom $p]
|
||||||
|
if {[string index $p end] eq {/}} {
|
||||||
|
set p [string range $p 0 end-1]
|
||||||
|
}
|
||||||
|
merge_state $p ?O
|
||||||
}
|
}
|
||||||
rescan_done $fd buf_rlo $after
|
rescan_done $fd buf_rlo $after
|
||||||
}
|
}
|
||||||
|
26
lib/diff.tcl
26
lib/diff.tcl
@ -84,12 +84,30 @@ proc show_diff {path w {lno {}}} {
|
|||||||
#
|
#
|
||||||
if {$m eq {_O}} {
|
if {$m eq {_O}} {
|
||||||
set max_sz [expr {128 * 1024}]
|
set max_sz [expr {128 * 1024}]
|
||||||
|
set type unknown
|
||||||
if {[catch {
|
if {[catch {
|
||||||
|
set type [file type $path]
|
||||||
|
switch -- $type {
|
||||||
|
directory {
|
||||||
|
set type submodule
|
||||||
|
set content {}
|
||||||
|
set sz 0
|
||||||
|
}
|
||||||
|
link {
|
||||||
|
set content [file readlink $path]
|
||||||
|
set sz [string length $content]
|
||||||
|
}
|
||||||
|
file {
|
||||||
set fd [open $path r]
|
set fd [open $path r]
|
||||||
fconfigure $fd -eofchar {}
|
fconfigure $fd -eofchar {}
|
||||||
set content [read $fd $max_sz]
|
set content [read $fd $max_sz]
|
||||||
close $fd
|
close $fd
|
||||||
set sz [file size $path]
|
set sz [file size $path]
|
||||||
|
}
|
||||||
|
default {
|
||||||
|
error "'$type' not supported"
|
||||||
|
}
|
||||||
|
}
|
||||||
} err ]} {
|
} err ]} {
|
||||||
set diff_active 0
|
set diff_active 0
|
||||||
unlock_index
|
unlock_index
|
||||||
@ -98,7 +116,12 @@ proc show_diff {path w {lno {}}} {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
$ui_diff conf -state normal
|
$ui_diff conf -state normal
|
||||||
if {![catch {set type [exec file $path]}]} {
|
if {$type eq {submodule}} {
|
||||||
|
$ui_diff insert end [append \
|
||||||
|
"* " \
|
||||||
|
[mc "Git Repository (subproject)"] \
|
||||||
|
"\n"] d_@
|
||||||
|
} elseif {![catch {set type [exec file $path]}]} {
|
||||||
set n [string length $path]
|
set n [string length $path]
|
||||||
if {[string equal -length $n $path $type]} {
|
if {[string equal -length $n $path $type]} {
|
||||||
set type [string range $type $n end]
|
set type [string range $type $n end]
|
||||||
@ -198,6 +221,7 @@ proc read_diff {fd} {
|
|||||||
if {[string match {mode *} $line]
|
if {[string match {mode *} $line]
|
||||||
|| [string match {new file *} $line]
|
|| [string match {new file *} $line]
|
||||||
|| [string match {deleted file *} $line]
|
|| [string match {deleted file *} $line]
|
||||||
|
|| [string match {deleted symlink} $line]
|
||||||
|| [string match {Binary files * and * differ} $line]
|
|| [string match {Binary files * and * differ} $line]
|
||||||
|| $line eq {\ No newline at end of file}
|
|| $line eq {\ No newline at end of file}
|
||||||
|| [regexp {^\* Unmerged path } $line]} {
|
|| [regexp {^\* Unmerged path } $line]} {
|
||||||
|
Loading…
Reference in New Issue
Block a user