[utils] Fix Get{RepositoryPath,SourceVersion} to have a more robust is-git-svn

check.

llvm-svn: 156836
This commit is contained in:
Daniel Dunbar 2012-05-15 18:44:09 +00:00
parent c4a8a76048
commit bf0bf743d7
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ fi
cd $1
if [ -d .svn ]; then
svn info | grep 'URL:' | cut -d: -f2-
elif [ -d .git/svn ]; then
elif [ -f .git/svn/.metadata ]; then
git svn info | grep 'URL:' | cut -d: -f2-
elif [ -d .git ]; then
git remote -v | grep 'fetch' | awk '{ print $2 }'

View File

@ -16,7 +16,7 @@ fi
cd $1
if [ -d .svn ]; then
svnversion | sed -e "s#\([0-9]*\)[A-Z]*#\1#"
elif [ -d .git/svn ]; then
elif [ -f .git/svn/.metadata ]; then
git svn info | grep 'Revision:' | cut -d: -f2-
elif [ -d .git ]; then
git log -1 --pretty=format:%H