diff options
author | Elijah Newren <newren@gmail.com> | 2018-06-30 18:24:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 13:13:17 -0700 |
commit | cffbfad50d1f37aea03520dd8d8ea983bc57da02 (patch) | |
tree | 65a5527116f958266b3237e4e50519f5034ab41c /merge.c | |
parent | fc54c1af3ec09bab8b8ea09768c2da4069b7f53e (diff) | |
download | git-cffbfad50d1f37aea03520dd8d8ea983bc57da02.tar.gz |
read-cache.c: move index_has_changes() from merge.c
Since index_has_change() is an index-related function, move it to
read-cache.c, only modifying it to avoid uses of the active_cache and
active_nr macros.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge.c')
-rw-r--r-- | merge.c | 31 |
1 files changed, 0 insertions, 31 deletions
@@ -17,37 +17,6 @@ static const char *merge_argument(struct commit *commit) return EMPTY_TREE_SHA1_HEX; } -int index_has_changes(struct strbuf *sb) -{ - struct object_id head; - int i; - - if (!get_oid_tree("HEAD", &head)) { - struct diff_options opt; - - diff_setup(&opt); - opt.flags.exit_with_status = 1; - if (!sb) - opt.flags.quick = 1; - do_diff_cache(&head, &opt); - diffcore_std(&opt); - for (i = 0; sb && i < diff_queued_diff.nr; i++) { - if (i) - strbuf_addch(sb, ' '); - strbuf_addstr(sb, diff_queued_diff.queue[i]->two->path); - } - diff_flush(&opt); - return opt.flags.has_changes != 0; - } else { - for (i = 0; sb && i < active_nr; i++) { - if (i) - strbuf_addch(sb, ' '); - strbuf_addstr(sb, active_cache[i]->name); - } - return !!active_nr; - } -} - int try_merge_command(const char *strategy, size_t xopts_nr, const char **xopts, struct commit_list *common, const char *head_arg, struct commit_list *remotes) |