Skip to content

Commit 30871d9

Browse files
committed
add submodule
1 parent 20ebb68 commit 30871d9

File tree

6 files changed

+834
-1
lines changed

6 files changed

+834
-1
lines changed

config.m4

+1-1
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 diff.c checkout.c filter.c ignore.c indexer.c pathspec.c patch.c merge.c note.c odb.c reflog.c blame.c packbuilder.c stash.c signature.c reset.c message.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 note.c odb.c reflog.c blame.c packbuilder.c stash.c signature.c reset.c message.c submodule.c, $ext_shared)
1111
PHP_ADD_INCLUDE([$ext_srcdir/libgit2/include])
1212

1313
# for now

ng.php

+1
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ public function shouldResource(Arg $arg)
389389
"git_reflog_entry",
390390
"git_blame",
391391
"git_packbuilder",
392+
"git_submodule",
392393
);
393394
}
394395

php_git2.c

+30
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
#include "signature.h"
6161
#include "reset.h"
6262
#include "message.h"
63+
#include "submodule.h"
6364

6465
int git2_resource_handle;
6566

@@ -813,6 +814,35 @@ static zend_function_entry php_git2_functions[] = {
813814
/* message */
814815
PHP_FE(git_message_prettify, arginfo_git_message_prettify)
815816

817+
/* submodule */
818+
PHP_FE(git_submodule_lookup, arginfo_git_submodule_lookup)
819+
PHP_FE(git_submodule_foreach, arginfo_git_submodule_foreach)
820+
PHP_FE(git_submodule_add_setup, arginfo_git_submodule_add_setup)
821+
PHP_FE(git_submodule_add_finalize, arginfo_git_submodule_add_finalize)
822+
PHP_FE(git_submodule_add_to_index, arginfo_git_submodule_add_to_index)
823+
PHP_FE(git_submodule_save, arginfo_git_submodule_save)
824+
PHP_FE(git_submodule_owner, arginfo_git_submodule_owner)
825+
PHP_FE(git_submodule_name, arginfo_git_submodule_name)
826+
PHP_FE(git_submodule_path, arginfo_git_submodule_path)
827+
PHP_FE(git_submodule_url, arginfo_git_submodule_url)
828+
PHP_FE(git_submodule_set_url, arginfo_git_submodule_set_url)
829+
PHP_FE(git_submodule_index_id, arginfo_git_submodule_index_id)
830+
PHP_FE(git_submodule_head_id, arginfo_git_submodule_head_id)
831+
PHP_FE(git_submodule_wd_id, arginfo_git_submodule_wd_id)
832+
PHP_FE(git_submodule_ignore, arginfo_git_submodule_ignore)
833+
PHP_FE(git_submodule_set_ignore, arginfo_git_submodule_set_ignore)
834+
PHP_FE(git_submodule_update, arginfo_git_submodule_update)
835+
PHP_FE(git_submodule_set_update, arginfo_git_submodule_set_update)
836+
PHP_FE(git_submodule_fetch_recurse_submodules, arginfo_git_submodule_fetch_recurse_submodules)
837+
PHP_FE(git_submodule_set_fetch_recurse_submodules, arginfo_git_submodule_set_fetch_recurse_submodules)
838+
PHP_FE(git_submodule_init, arginfo_git_submodule_init)
839+
PHP_FE(git_submodule_sync, arginfo_git_submodule_sync)
840+
PHP_FE(git_submodule_open, arginfo_git_submodule_open)
841+
PHP_FE(git_submodule_reload, arginfo_git_submodule_reload)
842+
PHP_FE(git_submodule_reload_all, arginfo_git_submodule_reload_all)
843+
PHP_FE(git_submodule_status, arginfo_git_submodule_status)
844+
PHP_FE(git_submodule_location, arginfo_git_submodule_location)
845+
816846
/* misc */
817847
PHP_FE(git_resource_type, arginfo_git_resource_type)
818848
PHP_FE_END

php_git2.h

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ enum php_git2_resource_type {
122122
PHP_GIT2_TYPE_REFLOG_ENTRY,
123123
PHP_GIT2_TYPE_BLAME,
124124
PHP_GIT2_TYPE_PACKBUILDER,
125+
PHP_GIT2_TYPE_SUBMODULE,
125126
};
126127

127128
typedef struct php_git2_t {
@@ -171,6 +172,7 @@ typedef struct php_git2_t {
171172
git_reflog_entry *reflog_entry;
172173
git_blame *blame;
173174
git_packbuilder *packbuilder;
175+
git_submodule *submodule;
174176
} v;
175177
int should_free_v;
176178
int resource_id;

0 commit comments

Comments
 (0)