forked from RogerGee/php-git2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clone.h
100 lines (83 loc) · 2.43 KB
/
clone.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
98
99
100
/*
* clone.h
*
* Copyright (C) Roger P. Gee
*/
#ifndef PHPGIT2_CLONE_H
#define PHPGIT2_CLONE_H
#include "checkout.h"
#include "remote.h"
namespace php_git2
{
class php_git_clone_options:
public php_option_array
{
public:
php_git_clone_options()
{
git_clone_init_options(&opts,GIT_CLONE_OPTIONS_VERSION);
}
git_clone_options* byval_git2()
{
if (!is_null()) {
array_wrapper arr(value);
php_git_checkout_options checkoutOpts;
php_git_fetch_options fetchOpts;
GIT2_ARRAY_LOOKUP_LONG(arr,bare,opts);
GIT2_ARRAY_LOOKUP_LONG(arr,local,opts);
GIT2_ARRAY_LOOKUP_STRING_NULLABLE(arr,checkout_branch,opts);
GIT2_ARRAY_LOOKUP_SUBOBJECT_DEREFERENCE(arr,checkoutOpts,checkout_opts,opts);
GIT2_ARRAY_LOOKUP_SUBOBJECT_DEREFERENCE(arr,fetchOpts,fetch_opts,opts);
GIT2_ARRAY_LOOKUP_CALLBACK_NULLABLE(
arr,
repository_create_callback,
repoCreateCallback,
repository_cb,
repository_cb_payload,
opts);
GIT2_ARRAY_LOOKUP_CALLBACK_NULLABLE(
arr,
remote_create_callback,
remoteCreateCallback,
remote_cb,
remote_cb_payload,
opts);
return &opts;
}
return nullptr;
}
private:
git_clone_options opts;
php_callback_sync repoCreateCallback;
php_callback_sync remoteCreateCallback;
};
} // namespace php_git2
// Functions:
static constexpr auto ZIF_GIT_CLONE = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_repository**,
const char*,
const char*,
const git_clone_options*>::func<git_clone>,
php_git2::local_pack<
php_git2::php_resource_ref<php_git2::php_git_repository>,
php_git2::php_string,
php_git2::php_string,
php_git2::php_git_clone_options
>,
1,
php_git2::sequence<1,2,3>,
php_git2::sequence<0,1,2,3>
>;
// Function Entries:
#define GIT_CLONE_FE \
PHP_GIT2_FE(git_clone,ZIF_GIT_CLONE,NULL)
#endif
/*
* Local Variables:
* mode:c++
* indent-tabs-mode:nil
* tab-width:4
* End:
*/