[utils] Fix Get{RepositoryPath,SourceVersion} to have a more robust is-git-svn
authorDaniel Dunbar <daniel@zuster.org>
Tue, 15 May 2012 18:44:09 +0000 (18:44 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 15 May 2012 18:44:09 +0000 (18:44 +0000)
check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156836 91177308-0d34-0410-b5e6-96231b3b80d8

utils/GetRepositoryPath
utils/GetSourceVersion

index 326231c9e5d41c5f3abcd4b776715be0b009f9e6..f3b0cc56e25506917b6cca307683c48691c5e791 100755 (executable)
@@ -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 }'
index cbed7daf5b618f1c80c398c9e267a58a1253444f..b57a6aa2f3af6652e71f9ba00050685afd3e4349 100755 (executable)
@@ -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