Skip to content

Commit

Permalink
Cleanup external API
Browse files Browse the repository at this point in the history
Some of the WIP API calls have been hidden in preparation for the next
minor release.
  • Loading branch information
vmg committed Jul 11, 2011
1 parent f27f29b commit bdd1882
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 7 deletions.
2 changes: 0 additions & 2 deletions include/git2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 36 additions & 2 deletions include/git2/net.h
Original file line number Diff line number Diff line change
@@ -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__

Expand All @@ -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;
Expand Down
33 changes: 33 additions & 0 deletions include/git2/refspec.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
/*
* 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
*
Expand Down
35 changes: 35 additions & 0 deletions include/git2/remote.h
Original file line number Diff line number Diff line change
@@ -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__

Expand All @@ -13,6 +37,15 @@
* - _del (needs support from config)
*/

/**
* @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
*
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions src/pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 6 additions & 0 deletions include/git2/pkt.h → src/pkt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/transport_git.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit bdd1882

Please sign in to comment.