diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-03-28 21:52:28 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-28 21:52:28 -0700 |
commit | 99f5b0845ac53f9f6e845fe4401e68fcef154690 (patch) | |
tree | 5647dacc82fa90cb8de24ec4f4b9abea249707cf /parse-options.c | |
parent | 3b37d9c17efd199a237435f7d8573008f6aa68c1 (diff) | |
parent | 28db756feead84929cdfaaee8bccd301384daab4 (diff) | |
download | git-99f5b0845ac53f9f6e845fe4401e68fcef154690.tar.gz |
Merge branch 'cc/cherry-pick-ff'
* cc/cherry-pick-ff:
revert: fix tiny memory leak in cherry-pick --ff
rebase -i: use new --ff cherry-pick option
Documentation: describe new cherry-pick --ff option
cherry-pick: add tests for new --ff option
revert: add --ff option to allow fast forward when cherry-picking
builtin/merge: make checkout_fast_forward() non static
parse-options: add parse_options_concat() to concat options
Diffstat (limited to 'parse-options.c')
-rw-r--r-- | parse-options.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c index c83035d013..8546d8526f 100644 --- a/parse-options.c +++ b/parse-options.c @@ -659,3 +659,18 @@ int parse_opt_tertiary(const struct option *opt, const char *arg, int unset) *target = unset ? 2 : 1; return 0; } + +int parse_options_concat(struct option *dst, size_t dst_size, struct option *src) +{ + int i, j; + + for (i = 0; i < dst_size; i++) + if (dst[i].type == OPTION_END) + break; + for (j = 0; i < dst_size; i++, j++) { + dst[i] = src[j]; + if (src[j].type == OPTION_END) + return 0; + } + return -1; +} |