diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-08-26 00:49:53 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-26 09:18:51 -0700 |
commit | 712516bcacacd45b4825ec649f15c3573f6fb42a (patch) | |
tree | d167bb0edd73ead266dad5914a2d1d49276cf4f0 /ll-merge.h | |
parent | 635a7bb1d807390bedfc1147d2052e8423bcd1e0 (diff) | |
download | git-712516bcacacd45b4825ec649f15c3573f6fb42a.tar.gz |
ll-merge: replace flag argument with options struct
Keeping track of the flag bits is proving more trouble than it's
worth. Instead, use a pointer to an options struct like most similar
APIs do.
Callers with no special requests can pass NULL to request the default
options.
Cc: Bert Wesarg <bert.wesarg@googlemail.com>
Cc: Avery Pennarun <apenwarr@gmail.com>
Helped-by: Justin Frankel <justin@cockos.com>
Helped-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.h')
-rw-r--r-- | ll-merge.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/ll-merge.h b/ll-merge.h index ff7ca87bfa..4b707f06c0 100644 --- a/ll-merge.h +++ b/ll-merge.h @@ -5,27 +5,18 @@ #ifndef LL_MERGE_H #define LL_MERGE_H -#define LL_OPT_VIRTUAL_ANCESTOR (1 << 0) -#define LL_OPT_FAVOR_MASK ((1 << 1) | (1 << 2)) -#define LL_OPT_FAVOR_SHIFT 1 -#define LL_OPT_RENORMALIZE (1 << 3) - -static inline int ll_opt_favor(int flag) -{ - return (flag & LL_OPT_FAVOR_MASK) >> LL_OPT_FAVOR_SHIFT; -} - -static inline int create_ll_flag(int favor) -{ - return ((favor << LL_OPT_FAVOR_SHIFT) & LL_OPT_FAVOR_MASK); -} +struct ll_merge_options { + unsigned virtual_ancestor : 1; + unsigned variant : 2; /* favor ours, favor theirs, or union merge */ + unsigned renormalize : 1; +}; int ll_merge(mmbuffer_t *result_buf, const char *path, mmfile_t *ancestor, const char *ancestor_label, mmfile_t *ours, const char *our_label, mmfile_t *theirs, const char *their_label, - int flag); + const struct ll_merge_options *opts); int ll_merge_marker_size(const char *path); |