diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-10-22 16:20:02 +0200 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-10-22 16:20:02 +0200 |
commit | feb7e99dcb3525f0b4896753c61af2a26926f6bd (patch) | |
tree | 6bab87a15427f29ad9c0e786cd8e01742bf1704f | |
parent | 603578f699ae4412db9a56ef4806f36c6db34e18 (diff) | |
download | git-buildpackage-feb7e99dcb3525f0b4896753c61af2a26926f6bd.tar.gz git-buildpackage-feb7e99dcb3525f0b4896753c61af2a26926f6bd.tar.bz2 git-buildpackage-feb7e99dcb3525f0b4896753c61af2a26926f6bd.zip |
use upstream-branch in case the tag doesn't exist
-rwxr-xr-x | git-buildpackage | 4 |
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 |