summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-11-19 02:33:04 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2006-11-19 03:46:07 (GMT)
commit54896cf7c150038bd286b909897673f85c691abc (patch)
tree35a15aeeacd99a90902bbb0a551ecf1bcc63c710 /git-gui
parentbca680b054ffa736e876075fad358bee1caa898a (diff)
downloadgit-54896cf7c150038bd286b909897673f85c691abc.zip
git-54896cf7c150038bd286b909897673f85c691abc.tar.gz
git-54896cf7c150038bd286b909897673f85c691abc.tar.bz2
git-gui: Allow adding untracked files in selection.
The previous implementation of do_include_selection did not actually add files in state _O (untracked, not added) into the repository when they were in the selection and Commit->Include Selected Files was used. This was due to the file state filtering logic being the same as that of Commit->Include All Files, which only considers existing files. Also fixed a minor issue with rejected attempts to amend an initial commit. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui21
1 files changed, 18 insertions, 3 deletions
diff --git a/git-gui b/git-gui
index 23efe47..d1054f6 100755
--- a/git-gui
+++ b/git-gui
@@ -1891,9 +1891,13 @@ proc include_helper {txt paths} {
foreach path $paths {
switch -- [lindex $file_states($path) 0] {
AM -
+ AD -
MM -
+ UM -
+ U_ -
_M -
- _D {
+ _D -
+ _O {
lappend pathList $path
if {$path eq $current_diff} {
set after {reshow_diff;}
@@ -1927,9 +1931,20 @@ proc do_include_selection {} {
proc do_include_all {} {
global file_states
+
+ set paths [list]
+ foreach path [array names file_states] {
+ switch -- [lindex $file_states($path) 0] {
+ AM -
+ AD -
+ MM -
+ _M -
+ _D {lappend paths $path}
+ }
+ }
include_helper \
{Including all modified files} \
- [array names file_states]
+ $paths
}
proc do_signoff {} {
@@ -1965,7 +1980,7 @@ proc do_select_commit_type {} {
# The amend request was rejected...
#
if {![string match amend* $commit_type]} {
- set commit_type new
+ set selected_commit_type new
}
}
}