public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
fixed auto_add_rm method - wasn't properly automatically deleting files, 
in the case of resolving a merge conflict
timcharper (author)
Fri Jun 13 14:19:58 -0700 2008
commit  f6b835ecbfc1abb875ce5a39579f59854db0f140
tree    37e2760289370f81a46c7a267dff38c92160e5a4
parent  14d72a15030f784324946129a0e7bbee2baecff5
...
260
261
262
263
 
264
265
266
...
260
261
262
 
263
264
265
266
0
@@ -260,7 +260,7 @@ module SCM
0
     
0
     def auto_add_rm(files)
0
       add_files = files.select{ |f| File.exist?(File.expand_path(f, path)) }
0
- remove_files = files.reject{ |f| ! File.exist?(File.expand_path(f, path)) }
0
+ remove_files = files.reject{ |f| File.exist?(File.expand_path(f, path)) }
0
       res = ""
0
       res << add(add_files) unless add_files.empty?
0
       res << rm(remove_files) unless remove_files.empty?
...
46
47
48
 
 
 
 
 
 
 
 
49
50
51
...
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -46,6 +46,14 @@ describe SCM::Git do
0
     @git.current_revision.should == "1234"
0
   end
0
   
0
+ it "should auto_add_rm files depending on their existence" do
0
+ File.stub!(:exist?).with("/base/existing_file.txt").and_return(true)
0
+ File.stub!(:exist?).with("/base/deleted_file.txt").and_return(false)
0
+ @git.should_receive(:add).with(["existing_file.txt"]).and_return("")
0
+ @git.should_receive(:rm).with(["deleted_file.txt"]).and_return("")
0
+ @git.auto_add_rm(["existing_file.txt", "deleted_file.txt"])
0
+ end
0
+
0
   describe "using submodule git relative paths" do
0
     before(:each) do
0
       @sub_git = Git.new(:parent => @git, :path => File.join(@git.path, "subproject"));

Comments

    No one has commented yet.