@matheusbsbs / matheus-bagliano / commits / 831244bd0d
Fork 0

revert: cleanup code for -x option

There was some dead code and option -x appeared in the short help message of git revert (when running "git revert -h") which was wrong. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Jun 2, 2010 at 07:58 UTC 831244bd0df6871c618fc8becbb5c0f1fb8f5459
1 file changed +1 -7
builtin/revert.c
+1 -7
@@ -58,7 +58,6 @@ static void parse_args(int argc, const char **argv)
58 struct option options[] = {
59 OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
60 OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"),
61 - OPT_BOOLEAN('x', NULL, &no_replay, "append commit name when cherry-picking"),
61 OPT_BOOLEAN('r', NULL, &noop, "no-op (backward compatibility)"),
62 OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
63 OPT_INTEGER('m', "mainline", &mainline, "parent number"),
@@ -71,6 +70,7 @@ static void parse_args(int argc, const char **argv)
70
71 if (action == CHERRY_PICK) {
72 struct option cp_extra[] = {
73 + OPT_BOOLEAN('x', NULL, &no_replay, "append commit name"),
74 OPT_BOOLEAN(0, "ff", &allow_ff, "allow fast-forward"),
75 OPT_END(),
76 };
@@ -379,10 +379,6 @@ static int revert_or_cherry_pick(int argc, const char **argv)
379 setenv(GIT_REFLOG_ACTION, me, 0);
380 parse_args(argc, argv);
381
382 - /* this is copied from the shell script, but it's never triggered... */
383 - if (action == REVERT && !no_replay)
384 - die("revert is incompatible with replay");
385 -
382 if (allow_ff) {
383 if (signoff)
384 die("cherry-pick --ff cannot be used with --signoff");
@@ -546,14 +542,12 @@ int cmd_revert(int argc, const char **argv, const char *prefix)
542 {
543 if (isatty(0))
544 edit = 1;
549 - no_replay = 1;
545 action = REVERT;
546 return revert_or_cherry_pick(argc, argv);
547 }
548
549 int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
550 {
556 - no_replay = 0;
551 action = CHERRY_PICK;
552 return revert_or_cherry_pick(argc, argv);
553 }