Move old index entry removal from "unpack_trees()" into the individual functions

This makes no changes to current code, but it allows the individual merge
functions to decide what to do about the old entry.  They might decide to
update it in place, rather than force them to always delete and re-add it.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Linus Torvalds
2007-08-10 12:15:54 -07:00
committed by Junio C Hamano
parent 79f5e0645a
commit b48d5a050a
2 changed files with 29 additions and 11 deletions

View File

@ -4,7 +4,8 @@
struct unpack_trees_options;
typedef int (*merge_fn_t)(struct cache_entry **src,
struct unpack_trees_options *options);
struct unpack_trees_options *options,
int remove);
struct unpack_trees_options {
int reset;
@ -29,9 +30,9 @@ struct unpack_trees_options {
extern int unpack_trees(unsigned n, struct tree_desc *t,
struct unpack_trees_options *options);
int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);
int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o, int);
int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o, int);
int bind_merge(struct cache_entry **src, struct unpack_trees_options *o, int);
int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o, int);
#endif