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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/pull.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index d979660482..1f45202037 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -1046,15 +1046,15 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]);
- if (!can_ff) {
- if (opt_ff) {
- if (!strcmp(opt_ff, "--ff-only"))
- die_ff_impossible();
- } else {
- if (rebase_unspecified && opt_verbosity >= 0)
- show_advice_pull_non_ff();
- }
+ /* ff-only takes precedence over rebase */
+ if (opt_ff && !strcmp(opt_ff, "--ff-only")) {
+ if (!can_ff)
+ die_ff_impossible();
+ opt_rebase = REBASE_FALSE;
}
+ /* If no action specified and we can't fast forward, then warn. */
+ if (!opt_ff && rebase_unspecified && !can_ff)
+ show_advice_pull_non_ff();
if (opt_rebase) {
int ret = 0;