hg-fast-export: work still if git-commands are not in PATH

In git 1.6.0, most git tools with a dash in the name will no
longer be installed in $bindir.  This patch makes hg-fast-export
use the "git <command>" form so it will work even if "git" is
the only piece of git machinery in the user's PATH.

On the other hand, the "git <command>" form does not help for
sourcing a shell script (with ".").  So use the full path to
source "git-sh-setup".

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
This commit is contained in:
Jonathan Nieder
2008-07-18 01:32:37 -05:00
committed by Rocco Rutte
parent 205c76749a
commit 8be4e6b3d0
3 changed files with 5 additions and 5 deletions

View File

@@ -86,7 +86,7 @@ def save_cache(filename,cache):
def get_git_sha1(name,type='heads'):
try:
# use git-rev-parse to support packed refs
cmd="GIT_DIR='%s' git-rev-parse --verify refs/%s/%s 2>/dev/null" % (os.getenv('GIT_DIR','/dev/null'),type,name)
cmd="GIT_DIR='%s' git rev-parse --verify refs/%s/%s 2>/dev/null" % (os.getenv('GIT_DIR','/dev/null'),type,name)
p=os.popen(cmd)
l=p.readline()
p.close()