summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-11-15 04:32:14 +0000
committerGerrit Code Review <review@openstack.org>2017-11-15 04:32:14 +0000
commitef47e1f55340e53bab58e8af92af0df7986e971a (patch)
tree7478a56a64569b508982547fbcd79500542360bc
parent3686e0967c8dafef082e6667128a3cb52d8c80d0 (diff)
parentd3d66a471529547d6df65c6bf9e26d7eeea91a80 (diff)
downloadgit-review-ef47e1f55340e53bab58e8af92af0df7986e971a.tar.gz
Merge "Support git 2.15 and newer"
-rw-r--r--doc/source/installation.rst2
-rwxr-xr-xgit_review/cmd.py8
-rw-r--r--git_review/tests/test_git_review.py6
3 files changed, 9 insertions, 7 deletions
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
index a64d6c7..c36891c 100644
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -16,6 +16,8 @@ For assistance installing pacakges from ``pypi`` on your OS check out
For installation from source simply add ``git-review`` to your $PATH
after installing the dependencies listed in requirements.txt
+.. note:: ``git-review`` requires git version 1.8 or greater.
+
Setup
=====
diff --git a/git_review/cmd.py b/git_review/cmd.py
index 71364e0..7695dbe 100755
--- a/git_review/cmd.py
+++ b/git_review/cmd.py
@@ -1232,11 +1232,11 @@ def checkout_review(branch_name, remote, remote_branch):
run_command_exc(CheckoutNewBranchFailed,
"git", "checkout", "-b",
branch_name, "FETCH_HEAD")
- # --set-upstream-to is not supported in git 1.7
+ # --set-upstream-to is supported starting in git 1.8
run_command_exc(SetUpstreamBranchFailed,
- "git", "branch", "--set-upstream",
- branch_name,
- '%s/%s' % (remote, remote_branch))
+ "git", "branch", "--set-upstream-to",
+ '%s/%s' % (remote, remote_branch),
+ branch_name)
except CheckoutNewBranchFailed as e:
if re.search("already exists\.?", e.output):
diff --git a/git_review/tests/test_git_review.py b/git_review/tests/test_git_review.py
index 443caad..de00486 100644
--- a/git_review/tests/test_git_review.py
+++ b/git_review/tests/test_git_review.py
@@ -310,9 +310,9 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
# track different branch than expected in changeset
branch = self._run_git('rev-parse', '--abbrev-ref', 'HEAD')
self._run_git('branch',
- '--set-upstream',
- branch,
- 'remotes/origin/other')
+ '--set-upstream-to',
+ 'remotes/origin/other',
+ branch)
self.assertRaises(
Exception, # cmd.BranchTrackingMismatch inside
self._run_git_review, '-d', change_id)