summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2020-02-04 10:38:31 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2020-06-22 19:04:08 +0100
commiteea63cb780fdd178a708d1993d2563597a15b117 (patch)
tree3d06cb3a14db354993afe31fd44cdee7596ff93d
parent53ed7494028990bcfc7ddd778ed264ad7348624e (diff)
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 <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xgit-debrebase2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-debrebase b/git-debrebase
index 8f36d9d..7814358 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) =