summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7d40edf)
raw | patch | inline | side by side (parent: 7d40edf)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Jan 2007 04:33:34 +0000 (23:33 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Jan 2007 07:54:24 +0000 (02:54 -0500) |
The list of states which are valid for update-index were a little
too verbose and fed a few too many cases to the program. We can
do better with less lines of code by using more pattern matching,
and since we already were globbing here there's little change in
runtime cost.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
too verbose and fed a few too many cases to the program. We can
do better with less lines of code by using more pattern matching,
and since we already were globbing here there's little change in
runtime cost.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 7bd2b87fe3e636d293308d2a861da0dd4da77c17..954b1983e8fbac7976e7a45ce6a9f84e6721c45c 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
incr update_index_cp
switch -glob -- [lindex $file_states($path) 0] {
- AD -
- MD -
- UD -
- _D {set new D_}
-
- _M -
- MM -
- UM -
- U_ -
- M_ {set new M_}
-
+ AD {set new __}
+ ?D {set new D_}
_O -
- AM -
- A_ {set new A_}
-
+ AM {set new A_}
+ U_ -
+ ?M {set new M_}
?? {continue}
}
-
- puts -nonewline $fd $path
- puts -nonewline $fd "\0"
+ puts -nonewline $fd "$path\0"
display_file $path $new
}
set after {}
foreach path $paths {
switch -glob -- [lindex $file_states($path) 0] {
- AM -
- AD -
- MM -
- MD -
- U? -
- _M -
- _D -
- _O {
+ _O -
+ ?M -
+ ?D -
+ U? {
lappend pathList $path
if {$path eq $current_diff} {
set after {reshow_diff;}
set paths [list]
foreach path [array names file_states] {
- switch -- [lindex $file_states($path) 0] {
- AM -
- AD -
- MM -
- MD -
- _M -
- _D {lappend paths $path}
+ switch -glob -- [lindex $file_states($path) 0] {
+ U? {continue}
+ ?M -
+ ?D {lappend paths $path}
}
}
- add_helper \
- {Adding all modified files} \
- $paths
+ add_helper {Adding all changed files} $paths
}
proc revert_helper {txt paths} {