Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-04-22 23:42:47 +0300
committerJunio C Hamano <gitster@pobox.com>2020-04-22 23:42:47 +0300
commitdfdce31ce6c9c4d7266031ea70f982e7f22bb525 (patch)
tree451a384d7d70ceaf0cf70f95f900d859de56826f /builtin/pull.c
parentb660a76d0f0f6b7bbf7e7d0b619edf0decc9d22e (diff)
parentfbae70ddc6da7df3f901d95da2b11b2cb58c8a29 (diff)
Merge branch 'en/pull-do-not-rebase-after-fast-forwarding'
"git pull --rebase" tried to run a rebase even after noticing that the pull results in a fast-forward and no rebase is needed nor sensible, for the past few years due to a mistake nobody noticed. * en/pull-do-not-rebase-after-fast-forwarding: pull: avoid running both merge and rebase
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 880eb298525..ef0baa0fe2d 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -1010,6 +1010,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (opt_rebase) {
int ret = 0;
+ int ran_ff = 0;
if ((recurse_submodules == RECURSE_SUBMODULES_ON ||
recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) &&
submodule_touches_in_range(the_repository, &rebase_fork_point, &curr_head))
@@ -1026,10 +1027,12 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (is_descendant_of(merge_head, list)) {
/* we can fast-forward this without invoking rebase */
opt_ff = "--ff-only";
+ ran_ff = 1;
ret = run_merge();
}
}
- ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
+ if (!ran_ff)
+ ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
if (!ret && (recurse_submodules == RECURSE_SUBMODULES_ON ||
recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND))