From eea63cb780fdd178a708d1993d2563597a15b117 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 Feb 2020 10:38:31 +0000 Subject: [PATCH] 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 --- git-debrebase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) = -- 2.30.2