Skip to content

Commit

Permalink
git-gui: fix diff for partially staged submodule changes
Browse files Browse the repository at this point in the history
When a submodule commit had already been staged and another commit had
been checked out inside the submodule, the diff always displayed the
submodule commit log messages between the last supermodule commit and
the working tree, totally ignoring the commit in the index.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Jens Lehmann authored and Shawn O. Pearce committed Aug 27, 2009
1 parent b350e46 commit af413de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/diff.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@ proc start_show_diff {cont_info {add_opts {}}} {

if {[string match {160000 *} [lindex $s 2]]
|| [string match {160000 *} [lindex $s 3]]} {
set cmd {submodule summary -- $current_diff_path}
set is_submodule_diff 1
if {$w eq $ui_index} {
set cmd {submodule summary --cached -- $current_diff_path}
} else {
set cmd {submodule summary --files -- $current_diff_path}
}
}

if {[catch {set fd [eval git_read --nice $cmd]} err]} {
Expand Down Expand Up @@ -343,9 +348,6 @@ proc read_diff {fd cont_info} {
}
set ::current_diff_inheader 0

if {[regexp {^\* } $line]} {
set is_submodule_diff 1
}
# -- Automatically detect if this is a 3 way diff.
#
if {[string match {@@@ *} $line]} {set is_3way_diff 1}
Expand Down

0 comments on commit af413de

Please sign in to comment.