From: Ian Jackson Date: Tue, 4 Feb 2020 10:38:31 +0000 (+0000) Subject: git-debrebase: new-upstream: Do not treat late options as version X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=eea63cb780fdd178a708d1993d2563597a15b117;p=dgit.git git-debrebase: new-upstream: Do not treat late options as version Instead of a new upstream version, the user may wish to pass -i. (Or other git-rebase options.) This is handled correctly when we are deciding whether to treat further arguments as additional piece specifications, but the new optional upstream version commitish was mishandled in this respect. Signed-off-by: Ian Jackson --- diff --git a/git-debrebase b/git-debrebase index 8f36d9dc..78143586 100755 --- a/git-debrebase +++ b/git-debrebase @@ -1973,7 +1973,7 @@ sub cmd_new_upstream () { $new_version = (new Dpkg::Version "$spec_version-1", check => 1); } - my $new_upstream = shift @ARGV; + my $new_upstream = (@ARGV && $ARGV[0] !~ m{^-}) ? shift @ARGV : undef; my $new_upstream_version = upstreamversion $new_version; my $new_upstream_used; ($new_upstream, $new_upstream_used) =