forked from RogerGee/php-git2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cherrypick.h
97 lines (83 loc) · 2.58 KB
/
cherrypick.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* cherrypick.h
*
* Copyright (C) Roger P. Gee
*/
#ifndef PHPGIT2_CHERRYPICK_H
#define PHPGIT2_CHERRYPICK_H
#include "merge.h"
#include "checkout.h"
namespace php_git2
{
// Provide a type for converting a PHP array into a git_cherrypick_options
// struct.
class php_git_cherrypick_options:
public php_option_array
{
public:
php_git_cherrypick_options()
{
git_cherrypick_init_options(&opts,GIT_CHERRYPICK_OPTIONS_VERSION);
}
git_cherrypick_options* byval_git2()
{
if (!is_null()) {
array_wrapper arr(value);
GIT2_ARRAY_LOOKUP_LONG(arr,mainline,opts);
GIT2_ARRAY_LOOKUP_SUBOBJECT_DEREFERENCE(arr,mergeOpts,merge_opts,opts);
GIT2_ARRAY_LOOKUP_SUBOBJECT_DEREFERENCE(arr,checkoutOpts,checkout_opts,opts);
return &opts;
}
return nullptr;
}
private:
git_cherrypick_options opts;
php_git_strarray_byval_array strarray;
php_git_merge_options mergeOpts;
php_git_checkout_options checkoutOpts;
};
} // namespace php_git2
static constexpr auto ZIF_GIT_CHERRYPICK = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_repository*,
git_commit*,
const git_cherrypick_options*>::func<git_cherrypick>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_resource<php_git2::php_git_commit>,
php_git2::php_git_cherrypick_options
>
>;
static constexpr auto ZIF_GIT_CHERRYPICK_COMMIT = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_index**,
git_repository*,
git_commit*,
git_commit*,
unsigned int,
const git_merge_options*>::func<git_cherrypick_commit>,
php_git2::local_pack<
php_git2::php_resource_ref<php_git2::php_git_index>,
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_resource<php_git2::php_git_commit>,
php_git2::php_resource<php_git2::php_git_commit>,
php_git2::php_long_cast<unsigned int>,
php_git2::php_git_merge_options
>,
1,
php_git2::sequence<1,2,3,4,5>,
php_git2::sequence<0,1,2,3,4,5>
>;
#define GIT_CHERRYPICK_FE \
PHP_GIT2_FE(git_cherrypick,ZIF_GIT_CHERRYPICK,NULL) \
PHP_GIT2_FE(git_cherrypick_commit,ZIF_GIT_CHERRYPICK_COMMIT,NULL)
#endif
/*
* Local Variables:
* mode:c++
* indent-tabs-mode:nil
* tab-width:4
* End:
*/