summaryrefslogtreecommitdiffstats
path: root/llvm/utils/git-svn
diff options
context:
space:
mode:
authorDavid Zarzycki <dave@znu.io>2019-09-07 06:44:52 +0000
committerDavid Zarzycki <dave@znu.io>2019-09-07 06:44:52 +0000
commit7faffd544b16f851a632d6b8f93e3c8485ff34bb (patch)
treee74898a8c51f96b34864d096437956a47328d50f /llvm/utils/git-svn
parented20dcb88b72fe6cec728c6bfd49f19d7f762840 (diff)
downloadbcm5719-llvm-7faffd544b16f851a632d6b8f93e3c8485ff34bb.tar.gz
bcm5719-llvm-7faffd544b16f851a632d6b8f93e3c8485ff34bb.zip
[git-llvm] Do not reinvent `@{upstream}`
Make `git-llvm` more robust when used with a nontrivial repository. https://reviews.llvm.org/D67262 llvm-svn: 371290
Diffstat (limited to 'llvm/utils/git-svn')
-rwxr-xr-xllvm/utils/git-svn/git-llvm14
1 files changed, 2 insertions, 12 deletions
diff --git a/llvm/utils/git-svn/git-llvm b/llvm/utils/git-svn/git-llvm
index 549a45558dd..e03479a6df1 100755
--- a/llvm/utils/git-svn/git-llvm
+++ b/llvm/utils/git-svn/git-llvm
@@ -190,16 +190,8 @@ def program_exists(cmd):
def get_default_rev_range():
- # Get the branch tracked by the current branch, as set by
- # git branch --set-upstream-to See http://serverfault.com/a/352236/38694.
- cur_branch = git('rev-parse', '--symbolic-full-name', 'HEAD')
- upstream_branch = git('for-each-ref', '--format=%(upstream:short)',
- cur_branch)
- if not upstream_branch:
- upstream_branch = 'origin/master'
-
# Get the newest common ancestor between HEAD and our upstream branch.
- upstream_rev = git('merge-base', 'HEAD', upstream_branch)
+ upstream_rev = git('merge-base', 'HEAD', '@{upstream}')
return '%s..' % upstream_rev
@@ -637,9 +629,7 @@ if __name__ == '__main__':
metavar='GIT_REVS',
type=str,
nargs='?',
- help="revs to push (default: everything not in the branch's "
- 'upstream, or not in origin/master if the branch lacks '
- 'an explicit upstream)')
+ help="revs to push (default: everything not in the upstream branch).")
parser_push.set_defaults(func=cmd_push)
parser_revert = subcommands.add_parser(
OpenPOWER on IntegriCloud