git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] pull: trivial cleanup

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jun 13, 2021, 04:59 UTC
Message-ID
<20210613045949.255090-3-felipe.contreras@gmail.com>
In-Reply-To
<20210613045949.255090-1-felipe.contreras@gmail.com>
There's no need to store ran_ff. Now it's obvious from the conditionals.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/pull.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/builtin/pull.c b/builtin/pull.c
index a22293b7db..80e2f55cbc 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -1053,7 +1053,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 
 	if (opt_rebase) {
 		int ret = 0;
-		int ran_ff = 0;
 
 		struct object_id newbase;
 		struct object_id upstream;
@@ -1068,11 +1067,10 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 		if (can_ff) {
 			/* we can fast-forward this without invoking rebase */
 			opt_ff = "--ff-only";
-			ran_ff = 1;
 			ret = run_merge();
-		}
-		if (!ran_ff)
+		} else {
 			ret = run_rebase(&newbase, &upstream);
+		}
 
 		if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON ||
 			     recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))
-- 
2.32.0
Previous: Elijah NewrenNext: Elijah Newren
Message 4 of 17 in “pull: obvious fixes”
  1. 0/3 pull: obvious fixesFelipe Contreras, Jun 13, 2021
  2. 3/3 pull: trivial whitespace style fixFelipe Contreras, Jun 13, 2021
  3. Elijah NewrenJun 14, 2021
  4. 2/3 pull: trivial cleanupFelipe Contreras, Jun 13, 2021
  5. Elijah NewrenJun 14, 2021
  6. 1/3 pull: cleanup autostash checkFelipe Contreras, Jun 13, 2021
  7. Elijah NewrenJun 14, 2021
  8. Felipe ContrerasJun 15, 2021
  9. Elijah NewrenJun 14, 2021
  10. Junio C HamanoJun 15, 2021
  11. Felipe ContrerasJun 15, 2021
  12. 0/3 pull: obvious fixesFelipe Contreras, Jun 17, 2021
  13. 1/3 pull: cleanup autostash checkFelipe Contreras, Jun 17, 2021
  14. 2/3 pull: trivial cleanupFelipe Contreras, Jun 17, 2021
  15. 3/3 pull: trivial whitespace style fixFelipe Contreras, Jun 17, 2021
  16. Elijah NewrenJun 17, 2021
  17. Felipe ContrerasJun 15, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.