Fix git tools when run against a worktree
authorrstone <rstone@FreeBSD.org>
Fri, 11 Nov 2016 23:07:31 +0000 (23:07 +0000)
committerrstone <rstone@FreeBSD.org>
Fri, 11 Nov 2016 23:07:31 +0000 (23:07 +0000)
commitd2cc2e52b4f55ddd49acd6f88ea289ac8dccde03
treed260c7b332e43ce5aa9aaffa8c192625ec748c6a
parentf1983589e84debf3268d3eee34bfb91c4153cc2e
Fix git tools when run against a worktree

In a git worktree, the gitdir is in an entirely different location.
In arcgit, use git rev-parse --git-dir to get the correct path to it
always.

When running git from outside of the work tree, as in importgit,
the path provided by git rev-parse --git-dir can be either a
relative or absolute path depending on the work tree.  Rather
than trying to deal with that, just use git -C.

Differential Revision: https://reviews.freebsd.org/D8501
Reviewed by: markj
tools/tools/git/arcgit
tools/tools/git/importgit