t/setup.sh: import test_line_count from git.git

This provides better output when the line count is wrong.  It also
handles excess whitespace around the output of "wc", for example on Mac
OS X which adds leading whitespace before the line count.

Signed-off-by: John Keeping <john@keeping.me.uk>
t1000: use test_line_count where appropriate

This avoids test failures caused by "wc -l" on OS X adding extra
whitespace.

Reported-by: Matt McClure <matthewlmcclure@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Merge branch 'handle-osx-wc-whitespace'

Fix tests that rely on "wc -l" just printing a line count.

* handle-osx-wc-whitespace:
  t1000: use test_line_count where appropriate
  t/setup.sh: import test_line_count from git.git
Make --version work in non-repository working directories

Wait to load git-sh-setup. It fails to load outside a repository.

Signed-off-by: Matt McClure <matthewlmcclure@gmail.com>
Merge branch 'version-when-not-in-repo'

Don't error out when run with just --version and not in a Git
repository.

* git://github.com/johnkeeping/git-integration:
  Make --version work in non-repository working directories