Commit 6c4a45e9b6db2e062d70268aa45a88571cbbea23

pull / push / fetch are subject to log limit

Commit diff

Support/app/controllers/log_controller.rb

 
1515
1616 def index
1717 params[:path] ||= git.make_local_path(git.paths.first)
18 params[:limit] ||= git.config["git-tmbundle.log.limit"] || DEFAULT_LOG_LIMIT
1918 path = params[:path]
2019 # Get the desired revision number
2120 if File.directory?(git.git_base + path)
2727 end
2828
2929 def log
30 params[:limit] ||= git.config["git-tmbundle.log.limit"] || DEFAULT_LOG_LIMIT
3031 log_params = params.reject { |key,value| [:controller, :action, :layout].include?(key) }
3132 @path = params[:path]
3233 @log_entries = git.log(log_params)
toggle raw diff

Support/spec/controllers/remote_controller_spec.rb

 
77 before(:each) do
88 Git.reset_mock!
99 @git = Git.singleton_new
10 @git.config.stub!(:[]).with("branch.master.remote").and_return("origin")
11 @git.config.stub!(:[]).with("git-tmbundle.log.limit").and_return(5)
1012 end
1113
1214 describe "fetching" do
1315 before(:each) do
1416 # query the sources
15 @git.config.stub!(:[]).with("branch.master.remote").and_return("origin")
1617 Git.command_response["branch"] = "* master\n"
1718 Git.command_response["config", "branch.master.remote"] = %Q{origin}
1819 Git.command_response["remote"] = %Q{origin}
1920
2021 git = Git.singleton_new
21 git.should_receive(:log).with({:path=>".", :revisions=>["74c0fdf", "d1c6bdd"]}).and_return(parse_log(fixture_file("log_with_diffs.txt")))
22 git.should_receive(:log).with(:path=>".", :revisions=>["74c0fdf", "d1c6bdd"], :limit => 5).and_return(parse_log(fixture_file("log_with_diffs.txt")))
2223
2324 Git.command_response["fetch", "origin"] = fixture_file("fetch_1_5_4_3_output.txt")
2425
4646 Git.command_response["branch"] = "* master\n"
4747 Git.command_response["branch", "-r"] = " origin/master\n origin/release\n"
4848 @git.config.stub!(:[]).with("remote.origin.fetch").and_return("+refs/heads/*:refs/remotes/origin/*")
49 @git.config.stub!(:[]).with("branch.master.remote").and_return('origin')
5049 @git.config.stub!(:[]).with("branch.master.merge").and_return("refs/heads/master")
5150 Git.command_response["remote"] = %Q{origin}
5251
8989 end
9090
9191 it "should run all git commands" do
92 Git.commands_ran.should == [["branch"], ["remote"], ["push", "origin", "master"], ["log", "865f920..f9ca10d", "."], ["branch"], ["branch"]]
92 Git.commands_ran.should == [["branch"], ["remote"], ["push", "origin", "master"], ["log", "-n", 5, "865f920..f9ca10d", "."], ["branch"], ["branch"]]
9393 end
9494
9595 it "should output log with diffs" do
toggle raw diff