Merge branch 'nd/status-refresh-progress'
[gitweb.git] / builtin / pull.c
index 681c127a07071c98641972227a28dbe7f77eaf70..798ecf7faf186ba337cc73e945ac0c7fefd94866 100644 (file)
@@ -22,6 +22,7 @@
 #include "tempfile.h"
 #include "lockfile.h"
 #include "wt-status.h"
+#include "commit-reach.h"
 
 enum rebase_type {
        REBASE_INVALID = -1,
@@ -562,7 +563,9 @@ static int pull_into_void(const struct object_id *merge_head,
         * index/worktree changes that the user already made on the unborn
         * branch.
         */
-       if (checkout_fast_forward(the_hash_algo->empty_tree, merge_head, 0))
+       if (checkout_fast_forward(the_repository,
+                                 the_hash_algo->empty_tree,
+                                 merge_head, 0))
                return 1;
 
        if (update_ref("initial pull", "HEAD", merge_head, curr_head, 0, UPDATE_REFS_DIE_ON_ERR))
@@ -799,7 +802,7 @@ static int run_rebase(const struct object_id *curr_head,
        struct argv_array args = ARGV_ARRAY_INIT;
 
        if (!get_octopus_merge_base(&oct_merge_base, curr_head, merge_head, fork_point))
-               if (!is_null_oid(fork_point) && !oidcmp(&oct_merge_base, fork_point))
+               if (!is_null_oid(fork_point) && oideq(&oct_merge_base, fork_point))
                        fork_point = NULL;
 
        argv_array_push(&args, "rebase");
@@ -902,7 +905,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                oidclr(&curr_head);
 
        if (!is_null_oid(&orig_head) && !is_null_oid(&curr_head) &&
-                       oidcmp(&orig_head, &curr_head)) {
+                       !oideq(&orig_head, &curr_head)) {
                /*
                 * The fetch involved updating the current branch.
                 *
@@ -915,7 +918,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                        "fast-forwarding your working tree from\n"
                        "commit %s."), oid_to_hex(&orig_head));
 
-               if (checkout_fast_forward(&orig_head, &curr_head, 0))
+               if (checkout_fast_forward(the_repository, &orig_head,
+                                         &curr_head, 0))
                        die(_("Cannot fast-forward your working tree.\n"
                                "After making sure that you saved anything precious from\n"
                                "$ git diff %s\n"
@@ -941,7 +945,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
                int ret = 0;
                if ((recurse_submodules == RECURSE_SUBMODULES_ON ||
                     recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) &&
-                   submodule_touches_in_range(&rebase_fork_point, &curr_head))
+                   submodule_touches_in_range(&the_index, &rebase_fork_point, &curr_head))
                        die(_("cannot rebase with locally recorded submodule modifications"));
                if (!autostash) {
                        struct commit_list *list = NULL;