From bece90889d5ac8d838e98152ce25f4009c25ebac Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Jun 16 2020 14:46:48 +0000 Subject: Suggest a way to track remote branch - update Adds real branch name to simplify copy&paste operation. Relates: https://pagure.io/rpkg/pull-request/507 JIRA: CLOUDBLD-1294 Signed-off-by: Ondrej Nosek --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 2ab2b98..6a24033 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -373,7 +373,7 @@ class Commands(object): msg = ( 'Unable to find remote branch. Use --release\n' 'If current branch has to track a remote branch, fix it with command:\n' - ' git branch -u origin/BRANCHNAME' + ' git branch -u origin/%s' % localbranch ) raise rpkgError(msg) # Trim off the refs/heads so that we're just working with diff --git a/tests/test_commands.py b/tests/test_commands.py index e52e23e..4363aae 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -183,7 +183,7 @@ class LoadBranchMergeTest(CommandTestCase): self.cmd.load_branch_merge() except rpkgError as e: self.assertIn('Unable to find remote branch. Use --release', str(e)) - self.assertIn('git branch -u origin/BRANCHNAME', str(e)) + self.assertIn('git branch -u origin/local-branch', str(e)) else: self.fail("It's expected to raise rpkgError, but not.")