Permalink
Browse files

handle error of git

  • Loading branch information...
1 parent e294bab commit c736629904b68c16f2ddfc98388030ffb64a3566 @jugyo committed Jan 6, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/cilite/checker.rb
View
@@ -17,11 +17,15 @@ def if_updated(&block)
end
def update
- `git fetch origin && git reset --hard origin/#{branch}`
+ unless system("git fetch origin && git reset --hard origin/#{branch}")
+ raise "failed to update origin/#{branch}"
+ end
end
def head
- `git rev-parse origin/#{branch}`.chomp
+ hash = `git rev-parse origin/#{branch}`.chomp
+ raise "failed to get HEAD commit of origin/#{branch}" unless $? == 0
+ hash
end
end
end

0 comments on commit c736629

Please sign in to comment.