public
Description: The Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/timcharper/git-tmbundle.git
pull / push / fetch are subject to log limit
timcharper (author)
Tue Apr 29 22:18:23 -0700 2008
commit  6c4a45e9b6db2e062d70268aa45a88571cbbea23
tree    11f846949ba4de53f63b78533c9170d4ba211478
parent  a0a2dd806c8fc61e64c79fc6bc41923ddf6cc9f2
...
15
16
17
18
19
20
21
...
28
29
30
 
31
32
33
...
15
16
17
 
18
19
20
...
27
28
29
30
31
32
33
0
@@ -15,7 +15,6 @@ class LogController < ApplicationController
0
   
0
   def index
0
     params[:path] ||= git.make_local_path(git.paths.first)
0
- params[:limit] ||= git.config["git-tmbundle.log.limit"] || DEFAULT_LOG_LIMIT
0
     path = params[:path]
0
     # Get the desired revision number
0
     if File.directory?(git.git_base + path)
0
@@ -28,6 +27,7 @@ class LogController < ApplicationController
0
   end
0
   
0
   def log
0
+ params[:limit] ||= git.config["git-tmbundle.log.limit"] || DEFAULT_LOG_LIMIT
0
     log_params = params.reject { |key,value| [:controller, :action, :layout].include?(key) }
0
     @path = params[:path]
0
     @log_entries = git.log(log_params)
...
7
8
9
 
 
10
11
12
13
14
15
16
17
18
19
20
21
 
22
23
24
...
45
46
47
48
49
50
51
...
89
90
91
92
 
93
94
95
...
7
8
9
10
11
12
13
14
15
16
 
17
18
19
20
21
 
22
23
24
25
...
46
47
48
 
49
50
51
...
89
90
91
 
92
93
94
95
0
@@ -7,18 +7,19 @@ describe RemoteController do
0
   before(:each) do
0
     Git.reset_mock!
0
     @git = Git.singleton_new
0
+ @git.config.stub!(:[]).with("branch.master.remote").and_return("origin")
0
+ @git.config.stub!(:[]).with("git-tmbundle.log.limit").and_return(5)
0
   end
0
   
0
   describe "fetching" do
0
     before(:each) do
0
       # query the sources
0
- @git.config.stub!(:[]).with("branch.master.remote").and_return("origin")
0
       Git.command_response["branch"] = "* master\n"
0
       Git.command_response["config", "branch.master.remote"] = %Q{origin}
0
       Git.command_response["remote"] = %Q{origin}
0
       
0
       git = Git.singleton_new
0
- git.should_receive(:log).with({:path=>".", :revisions=>["74c0fdf", "d1c6bdd"]}).and_return(parse_log(fixture_file("log_with_diffs.txt")))
0
+ git.should_receive(:log).with(:path=>".", :revisions=>["74c0fdf", "d1c6bdd"], :limit => 5).and_return(parse_log(fixture_file("log_with_diffs.txt")))
0
       
0
       Git.command_response["fetch", "origin"] = fixture_file("fetch_1_5_4_3_output.txt")
0
       
0
@@ -45,7 +46,6 @@ describe RemoteController do
0
       Git.command_response["branch"] = "* master\n"
0
       Git.command_response["branch", "-r"] = " origin/master\n origin/release\n"
0
       @git.config.stub!(:[]).with("remote.origin.fetch").and_return("+refs/heads/*:refs/remotes/origin/*")
0
- @git.config.stub!(:[]).with("branch.master.remote").and_return('origin')
0
       @git.config.stub!(:[]).with("branch.master.merge").and_return("refs/heads/master")
0
       Git.command_response["remote"] = %Q{origin}
0
     
0
@@ -89,7 +89,7 @@ describe RemoteController do
0
       end
0
       
0
       it "should run all git commands" do
0
- Git.commands_ran.should == [["branch"], ["remote"], ["push", "origin", "master"], ["log", "865f920..f9ca10d", "."], ["branch"], ["branch"]]
0
+ Git.commands_ran.should == [["branch"], ["remote"], ["push", "origin", "master"], ["log", "-n", 5, "865f920..f9ca10d", "."], ["branch"], ["branch"]]
0
       end
0
       
0
       it "should output log with diffs" do

Comments

    No one has commented yet.