Skip to content

Commit

Permalink
exit if git invocations fail
Browse files Browse the repository at this point in the history
Change-Id: I7223cf1398804cdc865d5ff27c3ea5ebc4c450be
Reviewed-on: http://review.membase.org/5981
Tested-by: Steve Yen <steve.yen@gmail.com>
Tested-by: Farshid Ghods <farshid.ghods@gmail.com>
Reviewed-by: Farshid Ghods <farshid.ghods@gmail.com>
  • Loading branch information
steveyen authored and farshidce committed May 6, 2011
1 parent 3528fb0 commit 2a21a4d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions fetch-manifest.rb
Expand Up @@ -54,18 +54,27 @@
print "#{name} #{revision}...\n"

unless File.directory?("#{path}/.git")
sh %{git clone #{fetch}#{name} #{path}}
sh %{git clone #{fetch}#{name} #{path}} do |ok, res|
exit(false) unless ok
end
else
Dir.chdir(path) do
sh %{git remote update}
sh %{git remote update} do |ok, res|
exit(false) unless ok
end
end
end

Dir.chdir(path) do
curr = `git rev-parse HEAD`.chomp

sh %{git fetch --tags}
sh %{git reset --hard origin/#{revision} || git reset --hard #{revision}}
sh %{git fetch --tags} do |ok, res|
exit(false) unless ok
end

sh %{git reset --hard origin/#{revision} || git reset --hard #{revision}} do |ok, res|
exit(false) unless ok
end

changes[name] =
"#{name} #{revision}...\n" +
Expand Down

0 comments on commit 2a21a4d

Please sign in to comment.