aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2007-10-22 16:20:02 +0200
committerGuido Guenther <agx@sigxcpu.org>2007-10-22 16:20:02 +0200
commitfeb7e99dcb3525f0b4896753c61af2a26926f6bd (patch)
tree6bab87a15427f29ad9c0e786cd8e01742bf1704f
parent603578f699ae4412db9a56ef4806f36c6db34e18 (diff)
use upstream-branch in case the tag doesn't exist
-rwxr-xr-xgit-buildpackage4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-buildpackage b/git-buildpackage
index ac18bb11..147e98e5 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -185,10 +185,14 @@ def main(argv):
# Build the orig.tar.gz if necessary:
if not is_native(cp) and not has_orig(cp, output_dir) and not options.no_create_orig:
+ # --upstream-branch was given on the command line, so use this:
if options.upstream_branch != GbpOptionParser.defaults['upstream-branch']:
upstream_tree = options.upstream_branch
else:
upstream_tree = build_tag(options.upstream_tag, cp['Upstream-Version'])
+ # fall back to the upstream-branch tip if the tag doesn't exist
+ if not repo.has_treeish(upstream_tree):
+ upstream_tree = GbpOptionParser.defaults['upstream-branch']
print "%s does not exist, creating from '%s'" % (orig_file(cp), upstream_tree)
if not repo.has_treeish(upstream_tree):
raise GbpError # git-ls-tree printed an error message already