Skip to content

Commit

Permalink
don't test the server if it appears to have a valid origin (#233)
Browse files Browse the repository at this point in the history
Signed-off-by: Tully Foote <tfoote@osrfoundation.org>
  • Loading branch information
tfoote committed Apr 20, 2020
1 parent 88214f3 commit 28fef58
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions _ruby_libs/vcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,14 @@ def initialize(local_path, uri)

if @origin.nil?

# check remote uri
begin
self.check_uri
rescue VCSException => e
raise VCSException.new("Could not reach git repository at uri: " + uri + ": " +e.msg)
end

# add remote
dputs " - adding remote for " << @uri << " to " << @local_path
@origin = @r.remotes.create('origin', @uri)
test_origin = @r.remotes.create('origin', @uri)

if not test_origin.check_connection(:fetch)
raise VCSException.new("Could not fetch from git repository at uri: " + uri)
end
@origin = test_origin
end
end

Expand Down

0 comments on commit 28fef58

Please sign in to comment.