Merge branch 'nd/the-index' into md/list-objects-filter-by-depth
authorJunio C Hamano <gitster@pobox.com>
Fri, 28 Dec 2018 18:41:41 +0000 (10:41 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2019 23:38:29 +0000 (15:38 -0800)
23 files changed:
1  2 
builtin/am.c
builtin/commit.c
builtin/fsck.c
builtin/merge.c
builtin/notes.c
builtin/pack-objects.c
builtin/pull.c
builtin/push.c
builtin/read-tree.c
builtin/rebase.c
builtin/rerere.c
builtin/reset.c
bundle.c
combine-diff.c
diff.c
diffcore-pickaxe.c
grep.c
pack-objects.h
read-cache.c
ref-filter.c
sequencer.c
sequencer.h
wt-status.c

diff --cc builtin/am.c
Simple merge
Simple merge
diff --cc builtin/fsck.c
Simple merge
diff --cc builtin/merge.c
Simple merge
diff --cc builtin/notes.c
Simple merge
Simple merge
diff --cc builtin/pull.c
Simple merge
diff --cc builtin/push.c
Simple merge
Simple merge
@@@ -598,12 -582,14 +598,12 @@@ static int reset_head(struct object_id 
        }
  
        tree = parse_tree_indirect(oid);
-       prime_cache_tree(the_repository->index, tree);
+       prime_cache_tree(the_repository, the_repository->index, tree);
  
 -      if (write_locked_index(the_repository->index, &lock, COMMIT_LOCK) < 0)
 +      if (write_locked_index(the_repository->index, &lock, COMMIT_LOCK) < 0) {
                ret = error(_("could not write index"));
 -      free((void *)desc.buffer);
 -
 -      if (ret)
 -              return ret;
 +              goto leave_reset_head;
 +      }
  
        reflog_action = getenv(GIT_REFLOG_ACTION_ENVIRONMENT);
        strbuf_addf(&msg, "%s: ", reflog_action ? reflog_action : "rebase");
@@@ -1037,15 -996,12 +1037,15 @@@ int cmd_rebase(int argc, const char **a
                struct string_list merge_rr = STRING_LIST_INIT_DUP;
  
                options.action = "skip";
 +              set_reflog_action(&options);
  
-               rerere_clear(&merge_rr);
+               rerere_clear(the_repository, &merge_rr);
                string_list_clear(&merge_rr, 1);
  
 -              if (reset_head(NULL, "reset", NULL, 0, NULL, NULL) < 0)
 +              if (reset_head(NULL, "reset", NULL, RESET_HEAD_HARD,
 +                             NULL, NULL) < 0)
                        die(_("could not discard worktree changes"));
-               remove_branch_state();
++              remove_branch_state(the_repository);
                if (read_basic_state(&options))
                        exit(1);
                goto run_rebase;
        case ACTION_ABORT: {
                struct string_list merge_rr = STRING_LIST_INIT_DUP;
                options.action = "abort";
 +              set_reflog_action(&options);
  
-               rerere_clear(&merge_rr);
+               rerere_clear(the_repository, &merge_rr);
                string_list_clear(&merge_rr, 1);
  
                if (read_basic_state(&options))
                        exit(1);
                if (reset_head(&options.orig_head, "reset",
 -                             options.head_name, 0, NULL, NULL) < 0)
 +                             options.head_name, RESET_HEAD_HARD,
 +                             NULL, NULL) < 0)
                        die(_("could not move back to %s"),
                            oid_to_hex(&options.orig_head));
-               remove_branch_state();
++              remove_branch_state(the_repository);
                ret = finish_rebase(&options);
                goto cleanup;
        }
Simple merge
diff --cc builtin/reset.c
Simple merge
diff --cc bundle.c
Simple merge
diff --cc combine-diff.c
Simple merge
diff --cc diff.c
Simple merge
Simple merge
diff --cc grep.c
Simple merge
diff --cc pack-objects.h
Simple merge
diff --cc read-cache.c
Simple merge
diff --cc ref-filter.c
Simple merge
diff --cc sequencer.c
@@@ -1969,7 -1942,7 +1992,7 @@@ static int read_and_refresh_cache(struc
  {
        struct lock_file index_lock = LOCK_INIT;
        int index_fd = hold_locked_index(&index_lock, 0);
-       if (read_index(&the_index) < 0) {
 -      if (read_index_preload(r->index, NULL, 0) < 0) {
++      if (read_index(r->index) < 0) {
                rollback_lock_file(&index_lock);
                return error(_("git %s: failed to read the index"),
                        _(action_name(opts)));
@@@ -3252,10 -3241,6 +3290,10 @@@ static int do_merge(struct repository *
                goto leave_merge;
        }
  
-                     git_path_merge_head(the_repository), 0);
-       write_message("no-ff", 5, git_path_merge_mode(the_repository), 0);
 +      write_message(oid_to_hex(&merge_commit->object.oid), GIT_SHA1_HEXSZ,
++                    git_path_merge_head(r), 0);
++      write_message("no-ff", 5, git_path_merge_mode(r), 0);
 +
        for (j = bases; j; j = j->next)
                commit_list_insert(j->item, &reversed);
        free_commit_list(bases);
@@@ -4901,11 -4893,11 +4948,11 @@@ int complete_action(struct repository *
  
        if (checkout_onto(opts, onto_name, oid_to_hex(&oid), orig_head))
                return -1;
 -;
 +
-       if (require_clean_work_tree("rebase", "", 1, 1))
+       if (require_clean_work_tree(r, "rebase", "", 1, 1))
                return -1;
  
-       return sequencer_continue(opts);
+       return sequencer_continue(r, opts);
  }
  
  struct subject2item_entry {
diff --cc sequencer.h
@@@ -128,11 -131,10 +131,13 @@@ int prepare_branch_to_be_rebased(struc
  
  #define SUMMARY_INITIAL_COMMIT   (1 << 0)
  #define SUMMARY_SHOW_AUTHOR_DATE (1 << 1)
- void print_commit_summary(const char *prefix, const struct object_id *oid,
+ void print_commit_summary(struct repository *repo,
+                         const char *prefix,
+                         const struct object_id *oid,
                          unsigned int flags);
 +
 +int read_author_script(const char *path, char **name, char **email, char **date,
 +                     int allow_missing);
  #endif
  
  void parse_strategy_opts(struct replay_opts *opts, char *raw_opts);
diff --cc wt-status.c
@@@ -1558,8 -1564,7 +1564,8 @@@ void wt_status_get_state(struct reposit
        struct stat st;
        struct object_id oid;
  
-       if (!stat(git_path_merge_head(the_repository), &st)) {
+       if (!stat(git_path_merge_head(r), &st)) {
 +              wt_status_check_rebase(NULL, state);
                state->merge_in_progress = 1;
        } else if (wt_status_check_rebase(NULL, state)) {
                ;               /* all set */