Auto merge of #6664 - greysteil:avoid-printing-git-error, r=colby-swandale
Auto merge of #6664 - greysteil:avoid-printing-git-error, r=colby-swandale

Avoid printing git error when checking version on badly packaged version

### What was the end-user problem that led to this PR?

The problem was https://github.com/bundler/bundler/issues/6453.

### What was your diagnosis of the problem?

A use had a version of Bundler packaged with Ruby 2.5.0 in RVM, but this version didn't include Bundler's git repo or any of the ivars which should have been set. As a result, Bundler was shelling out to git even though it wasn't in a git repo.

### What is your fix for the problem, implemented in this PR?

My fix is to show a nicer result in this case (just say that the SHA is unknown)

### Why did you choose this fix out of the possible options?

I chose this fix because ensuring Bundler is always packaged correctly by others isn't possible (although it seems weird and unlikely that a version without instance variables set would be used). Falling back to a cleaner error message is marginally nicer than what we currently have, and not much work.

Fixes #6453.

(cherry picked from commit e5e260e0433e78bbc4961a6655cd96131dc9a45c)

dilumnavanjana/bundler,mvz/bundler,dilumnavanjana/bundler,bundler/bundler,bundler/bundler,mvz/bundler