public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
moved method auto_add_rm to Git
timcharper (author)
Thu Apr 24 12:51:43 -0700 2008
commit  88e756e3c9db72f2a17af875167e2ec29bfbf66e
tree    f397cf5c29081ddf9fba889f325358d0ad2f06bf
parent  57d4ef4e20589827a0ed6c19843cfe749718ad2e
...
16
17
18
19
 
20
21
22
...
61
62
63
64
 
65
66
67
...
87
88
89
90
91
92
93
94
95
96
97
98
99
...
16
17
18
 
19
20
21
22
...
61
62
63
 
64
65
66
67
...
87
88
89
 
 
 
 
 
 
 
 
90
91
0
@@ -16,7 +16,7 @@ class CommitController < ApplicationController
0
     statuses = git.status(git.git_base)
0
     files = statuses.map { |status_options| (status_options[:status][:short] == "G") ? git.make_local_path(status_options[:path]) : nil }.compact
0
 
0
- auto_add_rm(files)
0
+ git.auto_add_rm(files)
0
     res = git.commit(message, [])
0
     
0
     render "_commit_result", :locals => { :result => res, :files => files, :message => message }
0
@@ -61,7 +61,7 @@ class CommitController < ApplicationController
0
       msg, files = show_commit_dialog(files, statuses)
0
 
0
       unless files.empty?
0
- auto_add_rm(files)
0
+ git.auto_add_rm(files)
0
         res = git.commit(msg, files, :amend => (params[:type] == "amend"))
0
         render "_commit_result", :locals => { :files => files, :message => msg, :result => res}
0
       end
0
@@ -87,12 +87,4 @@ class CommitController < ApplicationController
0
       files = res[2..-1]
0
       return msg, files
0
     end
0
-
0
- def auto_add_rm(files)
0
- git.chdir_base
0
- add_files = files.select{ |f| File.exists?(f) }
0
- remove_files = files.reject{ |f| File.exists?(f) }
0
- res = git.add(add_files) unless add_files.empty?
0
- res = git.rm(remove_files) unless remove_files.empty?
0
- end
0
 end
0
\ No newline at end of file
...
230
231
232
 
 
 
 
 
 
 
 
 
 
233
234
235
...
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
0
@@ -230,6 +230,16 @@ module SCM
0
       command("rm", *files)
0
     end
0
     
0
+ def auto_add_rm(files)
0
+ chdir_base
0
+ add_files = files.select{ |f| File.exists?(f) }
0
+ remove_files = files.reject{ |f| File.exists?(f) }
0
+ res = ""
0
+ res << add(add_files) unless add_files.empty?
0
+ res << rm(remove_files) unless remove_files.empty?
0
+ res
0
+ end
0
+
0
     def merge(merge_from_branch)
0
       parse_merge(command("merge", merge_from_branch))
0
     end

Comments

    No one has commented yet.