Re: [PATCH 1/8] rebase: simplify code related to imply_merge()

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

 



Hi Oswald

On 23/03/2023 16:22, Oswald Buddenhagen wrote:
The code's evolution left in some bits surrounding enum rebase_type that
don't really make sense any more. In particular, it makes no sense to
invoke imply_merge() if the type is already known not to be
REBASE_APPLY, and it makes no sense to assign the type after calling
imply_merge().

These look sensible, did imply_merges() use to do something more which made these calls useful?

Best Wishes

Phillip

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@xxxxxx>
---
  builtin/rebase.c | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/builtin/rebase.c b/builtin/rebase.c
index 5b7b908b66..8ffea0f0d8 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -372,7 +372,6 @@ static int parse_opt_keep_empty(const struct option *opt, const char *arg,
imply_merge(opts, unset ? "--no-keep-empty" : "--keep-empty");
  	opts->keep_empty = !unset;
-	opts->type = REBASE_MERGE;
  	return 0;
  }
@@ -1494,9 +1493,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
  		}
  	}
- if (options.type == REBASE_MERGE)
-		imply_merge(&options, "--merge");
-
  	if (options.root && !options.onto_name)
  		imply_merge(&options, "--root without --onto");
@@ -1534,7 +1530,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (options.type == REBASE_UNSPECIFIED) {
  		if (!strcmp(options.default_backend, "merge"))
-			imply_merge(&options, "--merge");
+			options.type = REBASE_MERGE;
  		else if (!strcmp(options.default_backend, "apply"))
  			options.type = REBASE_APPLY;
  		else



[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]

  Powered by Linux