summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-10 00:38:05 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-09-10 00:39:47 (GMT)
commit8938410189315979255c1dfcc3c0b7a4bf9953e5 (patch)
tree36c44b378b9b34c7bf5a9c39883444590f1e1c7d /git-gui.sh
parent3b9dfde3d636aeb961318d41b3ab59f72414d010 (diff)
downloadgit-8938410189315979255c1dfcc3c0b7a4bf9953e5.zip
git-8938410189315979255c1dfcc3c0b7a4bf9953e5.tar.gz
git-8938410189315979255c1dfcc3c0b7a4bf9953e5.tar.bz2
git-gui: Trim trailing slashes from untracked submodule names
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>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 6d67609..26eb5ac 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -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
}