Permalink
Browse files

Should not need to timeout at all

This is a command line application, so there is no need for a timeout
as the user can just abort the command instead.

Fixes GH-4.
  • Loading branch information...
1 parent 710bf9a commit 7806e63631d0e67144022b577f55b5b333f0e60a Stig Kleppe-Jørgensen committed Mar 8, 2012
Showing with 25 additions and 22 deletions.
  1. +25 −22 lib/git-up.rb
View
@@ -7,35 +7,38 @@ def run
raise GitError, "`git fetch` failed" unless $? == 0
@remote_map = nil # flush cache after fetch
- with_stash do
- returning_to_current_branch do
- col_width = branches.map { |b| b.name.length }.max + 1
+ # no timeout needed for a command line application
+ Grit::Git.with_timeout(0) do
+ with_stash do
+ returning_to_current_branch do
+ col_width = branches.map { |b| b.name.length }.max + 1
- branches.each do |branch|
- remote = remote_map[branch.name]
+ branches.each do |branch|
+ remote = remote_map[branch.name]
- print branch.name.ljust(col_width)
+ print branch.name.ljust(col_width)
- if remote.commit.sha == branch.commit.sha
- puts "up to date".green
- next
- end
+ if remote.commit.sha == branch.commit.sha
+ puts "up to date".green
+ next
+ end
- base = merge_base(branch.name, remote.name)
+ base = merge_base(branch.name, remote.name)
- if base == remote.commit.sha
- puts "ahead of upstream".green
- next
- end
+ if base == remote.commit.sha
+ puts "ahead of upstream".green
+ next
+ end
- if base == branch.commit.sha
- puts "fast-forwarding...".yellow
- else
- puts "rebasing...".yellow
- end
+ if base == branch.commit.sha
+ puts "fast-forwarding...".yellow
+ else
+ puts "rebasing...".yellow
+ end
- checkout(branch.name)
- rebase(remote)
+ checkout(branch.name)
+ rebase(remote)
+ end
end
end
end

0 comments on commit 7806e63

Please sign in to comment.