summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pyfedpkg/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 57b9a39..7705a80 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -724,8 +724,10 @@ class PackageModule:
raise FedpkgError('There are uncommitted changes in your repo')
# Need to check here to see if the local commit you want to build is
# pushed or not
- # This doesn't work if the local branch name doesn't match the remote
- if self.repo.git.rev_list('...origin/%s' % self.repo.active_branch):
+ branch = self.repo.active_branch
+ remote = self.repo.git.config('--get',
+ 'branch.%s.merge' % branch).replace('refs/heads', 'origin')
+ if self.repo.git.rev_list('%s...%s' % (branch, remote)):
raise FedpkgError('There are unpushed changes in your repo')
# Get the commit hash to build
commit = self.repo.iter_commits().next().sha