Skip to content

Commit

Permalink
git-gui: Trim trailing slashes from untracked submodule names
Browse files Browse the repository at this point in the history
Oddly enough `git ls-files --others` supplies us the name of an
untracked submodule by including the trailing slash but that
same git version will not accept the name with a trailing slash
through `git update-index --stdin`.  Stripping off that final
slash character before loading it into our file lists allows
git-gui to stage changes to submodules just like any other file.

This change should give git-gui users some basic submodule support,
but it is strictly at the plumbing level as we do not actually know
about calling the git-submodule porcelain that is a recent addition
to git 1.5.3.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Sep 10, 2007
1 parent 3b9dfde commit 8938410
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,11 @@ proc read_ls_others {fd after} {
set pck [split $buf_rlo "\0"]
set buf_rlo [lindex $pck end]
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
}
Expand Down

0 comments on commit 8938410

Please sign in to comment.