summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/git2.h2
-rw-r--r--include/git2/net.h38
-rw-r--r--include/git2/reflog.h2
-rw-r--r--include/git2/refspec.h39
-rw-r--r--include/git2/remote.h35
-rw-r--r--include/git2/types.h3
-rw-r--r--src/pkt.c5
-rw-r--r--src/pkt.h (renamed from include/git2/pkt.h)6
-rw-r--r--src/transport_git.c2
9 files changed, 118 insertions, 14 deletions
diff --git a/include/git2.h b/include/git2.h
index a8a430654..9729fd9be 100644
--- a/include/git2.h
+++ b/include/git2.h
@@ -58,9 +58,7 @@
#include "git2/remote.h"
#include "git2/refspec.h"
-
#include "git2/net.h"
#include "git2/transport.h"
-#include "git2/pkt.h"
#endif
diff --git a/include/git2/net.h b/include/git2/net.h
index 4bef90509..01b307dae 100644
--- a/include/git2/net.h
+++ b/include/git2/net.h
@@ -1,3 +1,27 @@
+/*
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2,
+ * as published by the Free Software Foundation.
+ *
+ * In addition to the permissions in the GNU General Public License,
+ * the authors give you unlimited permission to link the compiled
+ * version of this file into combinations with other programs,
+ * and to distribute those combinations without any restriction
+ * coming from the use of this file. (The General Public License
+ * restrictions do apply in other respects; for example, they cover
+ * modification of the file, and distribution when not linked into
+ * a combined executable.)
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef INCLUDE_net_h__
#define INCLUDE_net_h__
@@ -16,15 +40,25 @@
#define GIT_DIR_FETCH 0
#define GIT_DIR_PUSH 1
-/*
- * This is what we give out on ->ls()
+/**
+ * @file git2/net.h
+ * @brief Git networking declarations
+ * @ingroup Git
+ * @{
*/
+GIT_BEGIN_DECL
+/**
+ * Remote head description, given out on `ls` calls.
+ */
struct git_remote_head {
git_oid oid;
char *name;
};
+/**
+ * Array of remote heads
+ */
struct git_headarray {
unsigned int len;
struct git_remote_head **heads;
diff --git a/include/git2/reflog.h b/include/git2/reflog.h
index 8a2edca4d..7f2781fc3 100644
--- a/include/git2/reflog.h
+++ b/include/git2/reflog.h
@@ -81,7 +81,7 @@ GIT_EXTERN(unsigned int) git_reflog_entrycount(git_reflog *reflog);
*
* @param reflog a previously loaded reflog
* @param idx the position to lookup
- * @param the entry; NULL if not found
+ * @return the entry; NULL if not found
*/
GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, unsigned int idx);
diff --git a/include/git2/refspec.h b/include/git2/refspec.h
index 0cbe42ff7..b5361edbb 100644
--- a/include/git2/refspec.h
+++ b/include/git2/refspec.h
@@ -1,9 +1,42 @@
+/*
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2,
+ * as published by the Free Software Foundation.
+ *
+ * In addition to the permissions in the GNU General Public License,
+ * the authors give you unlimited permission to link the compiled
+ * version of this file into combinations with other programs,
+ * and to distribute those combinations without any restriction
+ * coming from the use of this file. (The General Public License
+ * restrictions do apply in other respects; for example, they cover
+ * modification of the file, and distribution when not linked into
+ * a combined executable.)
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef INCLUDE_git_refspec_h__
#define INCLUDE_git_refspec_h__
#include "git2/types.h"
/**
+ * @file git2/refspec.h
+ * @brief Git refspec attributes
+ * @defgroup git_refspec Git refspec attributes
+ * @ingroup Git
+ * @{
+ */
+GIT_BEGIN_DECL
+
+/**
* Get the source specifier
*
* @param refspec the refspec
@@ -33,10 +66,10 @@ int git_refspec_src_match(const git_refspec *refspec, const char *refname);
* Transform a reference to its target following the refspec's rules
*
* @param out where to store the target name
- * @param in the source reference
+ * @param outlen the size ouf the `out` buffer
* @param spec the refspec
- * @param len the length of the out buffer
+ * @param name the name of the reference to transform
* @preturn GIT_SUCCESS, GIT_ESHORTBUFFER or another error
*/
-int git_refspec_transform(char *out, size_t outlen, const git_refspec *spec, const char *name);
+int git_refspec_transform(char *out, size_t outlen, const git_refspec *spec, const char *name);
#endif
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 03e459569..fc05867c7 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -1,3 +1,27 @@
+/*
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2,
+ * as published by the Free Software Foundation.
+ *
+ * In addition to the permissions in the GNU General Public License,
+ * the authors give you unlimited permission to link the compiled
+ * version of this file into combinations with other programs,
+ * and to distribute those combinations without any restriction
+ * coming from the use of this file. (The General Public License
+ * restrictions do apply in other respects; for example, they cover
+ * modification of the file, and distribution when not linked into
+ * a combined executable.)
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
#ifndef INCLUDE_git_remote_h__
#define INCLUDE_git_remote_h__
@@ -14,6 +38,15 @@
*/
/**
+ * @file git2/remote.h
+ * @brief Git remote management
+ * @defgroup git_remote Git remote management routines
+ * @ingroup Git
+ * @{
+ */
+GIT_BEGIN_DECL
+
+/**
* Get the information for a particular remote
*
* @param out pointer to the new remote object
@@ -84,4 +117,6 @@ GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs);
*/
GIT_EXTERN(void) git_remote_free(struct git_remote *remote);
+GIT_END_DECL
+
#endif
diff --git a/include/git2/types.h b/include/git2/types.h
index 41d548234..256393e72 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -180,9 +180,6 @@ typedef struct git_remote git_remote;
/** A transport to use */
typedef struct git_transport git_transport;
-/** Whether to push or pull */
-typedef enum git_net_direction git_net_direction;
-
typedef int (*git_transport_cb)(git_transport **transport);
typedef struct git_remote_head git_remote_head;
diff --git a/src/pkt.c b/src/pkt.c
index f9ba8d0bc..215909055 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -23,11 +23,12 @@
* Boston, MA 02110-1301, USA.
*/
-#include "git2/pkt.h"
+#include "common.h"
+
#include "git2/types.h"
#include "git2/errors.h"
-#include "common.h"
+#include "pkt.h"
#include "util.h"
#include "netops.h"
diff --git a/include/git2/pkt.h b/src/pkt.h
index 0b17b3eed..28cad7c5e 100644
--- a/include/git2/pkt.h
+++ b/src/pkt.h
@@ -23,6 +23,10 @@
* Boston, MA 02110-1301, USA.
*/
+#ifndef INCLUDE_pkt_h__
+#define INCLUDE_pkt_h__
+
+#include "common.h"
#include "git2/net.h"
enum git_pkt_type {
@@ -54,3 +58,5 @@ struct git_pkt_ref {
int git_pkt_parse_line(git_pkt **head, const char *line, const char **out, size_t len);
int git_pkt_send_flush(int s);
void git_pkt_free(git_pkt *pkt);
+
+#endif
diff --git a/src/transport_git.c b/src/transport_git.c
index b3e940731..b07b98660 100644
--- a/src/transport_git.c
+++ b/src/transport_git.c
@@ -24,13 +24,13 @@
*/
#include "git2/net.h"
-#include "git2/pkt.h"
#include "git2/common.h"
#include "git2/types.h"
#include "git2/errors.h"
#include "vector.h"
#include "transport.h"
+#include "pkt.h"
#include "common.h"
#include "netops.h"