summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-07-28 16:47:48 -0700
committerJesse Keating <jkeating@redhat.com>2010-07-28 16:51:37 -0700
commitc9b1b3faa2fc51e79ffc67c8b26791b8164d489e (patch)
treec2d6b0be33fea5cf98e77ebc822dfaa83226692f /src/pyfedpkg
parent4188315ed718117f15a8eaef0640dbf710824f72 (diff)
downloadfedora-packager-c9b1b3faa2fc51e79ffc67c8b26791b8164d489e.tar.gz
fedora-packager-c9b1b3faa2fc51e79ffc67c8b26791b8164d489e.tar.xz
fedora-packager-c9b1b3faa2fc51e79ffc67c8b26791b8164d489e.zip
Fix checking for unpushed changes on a branch
Diffstat (limited to 'src/pyfedpkg')
-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