Skip to content

Commit bd18688

Browse files
committed
add several stubs
1 parent 0fbb04d commit bd18688

19 files changed

Lines changed: 2523 additions & 1 deletion

checkout.c

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#include "php_git2.h"
2+
#include "php_git2_priv.h"
3+
#include "checkout.h"
4+
/* {{{ proto long git_checkout_head(repo, opts)
5+
*/
6+
PHP_FUNCTION(git_checkout_head)
7+
{
8+
zval *repo;
9+
php_git2_t *_repo;
10+
zval *opts;
11+
php_git2_t *_opts;
12+
13+
/* TODO(chobie): implement this */
14+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "git_checkout_head not implemented yet");
15+
return;
16+
17+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
18+
"rr", &repo, &opts) == FAILURE) {
19+
return;
20+
}
21+
ZEND_FETCH_RESOURCE(_repo, php_git2_t*, &repo, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle);
22+
}
23+
24+
/* {{{ proto long git_checkout_index(repo, index, opts)
25+
*/
26+
PHP_FUNCTION(git_checkout_index)
27+
{
28+
zval *repo;
29+
php_git2_t *_repo;
30+
zval *index;
31+
php_git2_t *_index;
32+
zval *opts;
33+
php_git2_t *_opts;
34+
35+
/* TODO(chobie): implement this */
36+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "git_checkout_index not implemented yet");
37+
return;
38+
39+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
40+
"rrr", &repo, &index, &opts) == FAILURE) {
41+
return;
42+
}
43+
ZEND_FETCH_RESOURCE(_repo, php_git2_t*, &repo, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle);
44+
}
45+
46+
/* {{{ proto long git_checkout_tree(repo, treeish, opts)
47+
*/
48+
PHP_FUNCTION(git_checkout_tree)
49+
{
50+
zval *repo;
51+
php_git2_t *_repo;
52+
zval *treeish;
53+
php_git2_t *_treeish;
54+
zval *opts;
55+
php_git2_t *_opts;
56+
57+
/* TODO(chobie): implement this */
58+
php_error_docref(NULL TSRMLS_CC, E_WARNING, "git_checkout_tree not implemented yet");
59+
return;
60+
61+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
62+
"rrr", &repo, &treeish, &opts) == FAILURE) {
63+
return;
64+
}
65+
ZEND_FETCH_RESOURCE(_repo, php_git2_t*, &repo, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle);
66+
}
67+

checkout.h

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* PHP Libgit2 Extension
3+
*
4+
* https://github.com/libgit2/php-git
5+
*
6+
* Copyright 2014 Shuhei Tanuma. All rights reserved.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
#ifndef PHP_GIT2_CHECKOUT_H
27+
#define PHP_GIT2_CHECKOUT_H
28+
29+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_checkout_head, 0, 0, 2)
30+
ZEND_ARG_INFO(0, repo)
31+
ZEND_ARG_INFO(0, opts)
32+
ZEND_END_ARG_INFO()
33+
34+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_checkout_index, 0, 0, 3)
35+
ZEND_ARG_INFO(0, repo)
36+
ZEND_ARG_INFO(0, index)
37+
ZEND_ARG_INFO(0, opts)
38+
ZEND_END_ARG_INFO()
39+
40+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_checkout_tree, 0, 0, 3)
41+
ZEND_ARG_INFO(0, repo)
42+
ZEND_ARG_INFO(0, treeish)
43+
ZEND_ARG_INFO(0, opts)
44+
ZEND_END_ARG_INFO()
45+
46+
/* {{{ proto long git_checkout_head(repo, opts)
47+
*/
48+
PHP_FUNCTION(git_checkout_head);
49+
50+
/* {{{ proto long git_checkout_index(repo, index, opts)
51+
*/
52+
PHP_FUNCTION(git_checkout_index);
53+
54+
/* {{{ proto long git_checkout_tree(repo, treeish, opts)
55+
*/
56+
PHP_FUNCTION(git_checkout_tree);
57+
58+
#endif

config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PHP_ARG_ENABLE(git2-debug, for git2 debug support,
77
if test $PHP_GIT2 != "no"; then
88
PHP_SUBST(GIT2_SHARED_LIBADD)
99

10-
PHP_NEW_EXTENSION(git2, php_git2.c repository.c commit.c tree.c clone.c blob.c helper.c revwalk.c treebuilder.c reference.c g_config.c object.c index.c revparse.c branch.c tag.c status.c cred.c remote.c transport.c, $ext_shared)
10+
PHP_NEW_EXTENSION(git2, php_git2.c repository.c commit.c tree.c clone.c blob.c helper.c revwalk.c treebuilder.c reference.c g_config.c object.c index.c revparse.c branch.c tag.c status.c cred.c remote.c transport.c diff.c checkout.c filter.c ignore.c indexer.c pathspec.c patch.c merge.c, $ext_shared)
1111
PHP_ADD_INCLUDE([$ext_srcdir/libgit2/include])
1212

1313
# for now

diff.c

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#include "php_git2.h"
2+
#include "php_git2_priv.h"
3+
#include "diff.h"
4+
5+
/* {{{ proto void git_diff_free(diff)
6+
*/
7+
PHP_FUNCTION(git_diff_free)
8+
{
9+
}
10+
11+
/* {{{ proto resource git_diff_tree_to_tree(repo, old_tree, new_tree, opts)
12+
*/
13+
PHP_FUNCTION(git_diff_tree_to_tree)
14+
{
15+
}
16+
17+
/* {{{ proto resource git_diff_tree_to_index(repo, old_tree, index, opts)
18+
*/
19+
PHP_FUNCTION(git_diff_tree_to_index)
20+
{
21+
}
22+
23+
/* {{{ proto resource git_diff_index_to_workdir(repo, index, opts)
24+
*/
25+
PHP_FUNCTION(git_diff_index_to_workdir)
26+
{
27+
}
28+
29+
/* {{{ proto resource git_diff_tree_to_workdir(repo, old_tree, opts)
30+
*/
31+
PHP_FUNCTION(git_diff_tree_to_workdir)
32+
{
33+
}
34+
35+
/* {{{ proto resource git_diff_tree_to_workdir_with_index(repo, old_tree, opts)
36+
*/
37+
PHP_FUNCTION(git_diff_tree_to_workdir_with_index)
38+
{
39+
}
40+
41+
/* {{{ proto long git_diff_merge(onto, from)
42+
*/
43+
PHP_FUNCTION(git_diff_merge)
44+
{
45+
}
46+
47+
/* {{{ proto long git_diff_find_similar(diff, options)
48+
*/
49+
PHP_FUNCTION(git_diff_find_similar)
50+
{
51+
}
52+
53+
/* {{{ proto long git_diff_options_init(options, version)
54+
*/
55+
PHP_FUNCTION(git_diff_options_init)
56+
{
57+
}
58+
59+
/* {{{ proto resource git_diff_num_deltas(diff)
60+
*/
61+
PHP_FUNCTION(git_diff_num_deltas)
62+
{
63+
}
64+
65+
/* {{{ proto resource git_diff_num_deltas_of_type(diff, type)
66+
*/
67+
PHP_FUNCTION(git_diff_num_deltas_of_type)
68+
{
69+
}
70+
71+
/* {{{ proto resource git_diff_get_delta(diff, idx)
72+
*/
73+
PHP_FUNCTION(git_diff_get_delta)
74+
{
75+
}
76+
77+
/* {{{ proto long git_diff_is_sorted_icase(diff)
78+
*/
79+
PHP_FUNCTION(git_diff_is_sorted_icase)
80+
{
81+
}
82+
83+
/* {{{ proto long git_diff_foreach(diff, file_cb, hunk_cb, line_cb, payload)
84+
*/
85+
PHP_FUNCTION(git_diff_foreach)
86+
{
87+
}
88+
89+
/* {{{ proto resource git_diff_status_char(status)
90+
*/
91+
PHP_FUNCTION(git_diff_status_char)
92+
{
93+
}
94+
95+
/* {{{ proto long git_diff_print(diff, format, print_cb, payload)
96+
*/
97+
PHP_FUNCTION(git_diff_print)
98+
{
99+
}
100+
101+
/* {{{ proto long git_diff_blobs(old_blob, old_as_path, new_blob, new_as_path, options, file_cb, hunk_cb, line_cb, payload)
102+
*/
103+
PHP_FUNCTION(git_diff_blobs)
104+
{
105+
}
106+
107+
/* {{{ proto long git_diff_blob_to_buffer(old_blob, old_as_path, buffer, buffer_len, buffer_as_path, options, file_cb, hunk_cb, line_cb, payload)
108+
*/
109+
PHP_FUNCTION(git_diff_blob_to_buffer)
110+
{
111+
}
112+

0 commit comments

Comments
 (0)