This can be:

```ruby
return unless git =~ /^#{URI::regexp}$/
```