[PATCH/RFC 07/20] rebase: stricter check on arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To align git-rebase.sh better with git-rebase--interactive.sh, be
stricter about checking that, when used, '--continue', '--skip' and
'--abort' is the only argument.

Since $strategy and $verbose are currently saved only by interactive
rebase, checking that they are not passed on the command line would
break any existing uses of 'git rebase --strategy=<x> --continue'.
Instead, relax the check and let the options be ignored by interactive
rebase once refactored (the relaxation will not be effective until
further refactoring, however).

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@xxxxxxxxx>
---
 git-rebase.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/git-rebase.sh b/git-rebase.sh
index 2358e2f..feda4be 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -317,6 +317,10 @@ test $# -gt 2 && usage
 
 if test -n "$action"
 then
+	test $# -eq 0 &&
+	test -z "$onto" &&
+	test -z "$preserve_merges" ||
+	usage
 	test -d "$merge_dir" -o -d "$apply_dir" || die "No rebase in progress?"
 else
 	# Make sure we do not have $apply_dir or $merge_dir
-- 
1.7.3.2.864.gbbb96

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]