From c9b1b3faa2fc51e79ffc67c8b26791b8164d489e Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 28 Jul 2010 16:47:48 -0700 Subject: Fix checking for unpushed changes on a branch --- src/pyfedpkg/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pyfedpkg') 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 -- cgit