From: Markus Lehtonen Date: Tue, 10 Feb 2015 12:19:58 +0000 (+0200) Subject: pq-rpm: unbreak patch generation if end point is a tree object X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=489c2b899787a6ff0a0d770ed8ce08ec2f56d2b8;p=tools%2Fgit-buildpackage.git pq-rpm: unbreak patch generation if end point is a tree object Signed-off-by: Markus Lehtonen --- diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py index 9572790e..09d332e5 100755 --- a/gbp/scripts/pq_rpm.py +++ b/gbp/scripts/pq_rpm.py @@ -85,12 +85,12 @@ def generate_patches(repo, start, squash, end, outdir, options): raise GbpError('Invalid treeish object %s' % treeish) start_sha1 = repo.rev_parse("%s^0" % start) - try: - end_commit = end - except GitRepositoryError: - # In case of plain tree-ish objects, assume current branch head is the - # last commit + # In case of plain tree-ish objects, assume current branch head is the + # last commit + if repo.get_obj_type(end) == 'tree': end_commit = "HEAD" + else: + end_commit = end end_commit_sha1 = repo.rev_parse("%s^0" % end_commit) start_sha1 = repo.rev_parse("%s^0" % start)