summaryrefslogtreecommitdiffstats
path: root/llvm/utils/git-svn
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2019-05-03 22:03:29 +0000
committerCraig Topper <craig.topper@intel.com>2019-05-03 22:03:29 +0000
commit99f8c4f5b659ab92c8eafc6dc9f887f1af465eb0 (patch)
treeb9fc3ffc79db7b23d8404e62c1acbd1fdd144fd4 /llvm/utils/git-svn
parentd9dcf392c7bd55823501323a8215dfd831e66e0c (diff)
downloadbcm5719-llvm-99f8c4f5b659ab92c8eafc6dc9f887f1af465eb0.tar.gz
bcm5719-llvm-99f8c4f5b659ab92c8eafc6dc9f887f1af465eb0.zip
Make the git-llvm script work on older git versions that don't support git rev-parse --git-common-dir.
Not all versions of git support git rev-parse --git-common-dir. Rather than erorr or print any kind of useful error, they just print back '--git-common-dir' instead of a directory. The git-llvm script ends up taking this '--git-common-dir' as a diretory name to use. Not sure exactly what happens after that, but the end result is that the 'git llvm push' ends up looking like it pushed your commits, but really did nothing. This patch makes the script detect the bogus directory name for --git-common-dir and falls back to using --git-dir instead. llvm-svn: 359939
Diffstat (limited to 'llvm/utils/git-svn')
-rwxr-xr-xllvm/utils/git-svn/git-llvm5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm
index 0afa836865d..28a0a9bbf4d 100755
--- a/llvm/utils/git-svn/git-llvm
+++ b/llvm/utils/git-svn/git-llvm
@@ -392,6 +392,11 @@ def cmd_push(args):
# We need a staging area for SVN, let's hide it in the .git directory.
dot_git_dir = git('rev-parse', '--git-common-dir')
+ # Not all versions of git support --git-common-dir and just print the
+ # unknown command back. If this happens, fall back to --git-dir
+ if dot_git_dir == '--git-common-dir':
+ dot_git_dir = git('rev-parse', '--git-dir')
+
svn_root = os.path.join(dot_git_dir, 'llvm-upstream-svn')
svn_init(svn_root)
OpenPOWER on IntegriCloud