Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

handle error of git

  • Loading branch information...
commit c736629904b68c16f2ddfc98388030ffb64a3566 1 parent e294bab
@jugyo authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/cilite/checker.rb
View
8 lib/cilite/checker.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.