Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdd1882

Browse files
committed
Cleanup external API
Some of the WIP API calls have been hidden in preparation for the next minor release.
1 parent f27f29b commit bdd1882

File tree

7 files changed

+114
-7
lines changed

7 files changed

+114
-7
lines changed

include/git2.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@
5858

5959
#include "git2/remote.h"
6060
#include "git2/refspec.h"
61-
6261
#include "git2/net.h"
6362
#include "git2/transport.h"
64-
#include "git2/pkt.h"
6563

6664
#endif

include/git2/net.h

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This file is free software; you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License, version 2,
4+
* as published by the Free Software Foundation.
5+
*
6+
* In addition to the permissions in the GNU General Public License,
7+
* the authors give you unlimited permission to link the compiled
8+
* version of this file into combinations with other programs,
9+
* and to distribute those combinations without any restriction
10+
* coming from the use of this file. (The General Public License
11+
* restrictions do apply in other respects; for example, they cover
12+
* modification of the file, and distribution when not linked into
13+
* a combined executable.)
14+
*
15+
* This file is distributed in the hope that it will be useful, but
16+
* WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program; see the file COPYING. If not, write to
22+
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23+
* Boston, MA 02110-1301, USA.
24+
*/
125
#ifndef INCLUDE_net_h__
226
#define INCLUDE_net_h__
327

@@ -16,15 +40,25 @@
1640
#define GIT_DIR_FETCH 0
1741
#define GIT_DIR_PUSH 1
1842

19-
/*
20-
* This is what we give out on ->ls()
43+
/**
44+
* @file git2/net.h
45+
* @brief Git networking declarations
46+
* @ingroup Git
47+
* @{
2148
*/
49+
GIT_BEGIN_DECL
2250

51+
/**
52+
* Remote head description, given out on `ls` calls.
53+
*/
2354
struct git_remote_head {
2455
git_oid oid;
2556
char *name;
2657
};
2758

59+
/**
60+
* Array of remote heads
61+
*/
2862
struct git_headarray {
2963
unsigned int len;
3064
struct git_remote_head **heads;

include/git2/refspec.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
1+
/*
2+
* This file is free software; you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License, version 2,
4+
* as published by the Free Software Foundation.
5+
*
6+
* In addition to the permissions in the GNU General Public License,
7+
* the authors give you unlimited permission to link the compiled
8+
* version of this file into combinations with other programs,
9+
* and to distribute those combinations without any restriction
10+
* coming from the use of this file. (The General Public License
11+
* restrictions do apply in other respects; for example, they cover
12+
* modification of the file, and distribution when not linked into
13+
* a combined executable.)
14+
*
15+
* This file is distributed in the hope that it will be useful, but
16+
* WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program; see the file COPYING. If not, write to
22+
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23+
* Boston, MA 02110-1301, USA.
24+
*/
125
#ifndef INCLUDE_git_refspec_h__
226
#define INCLUDE_git_refspec_h__
327

428
#include "git2/types.h"
529

30+
/**
31+
* @file git2/refspec.h
32+
* @brief Git refspec attributes
33+
* @defgroup git_refspec Git refspec attributes
34+
* @ingroup Git
35+
* @{
36+
*/
37+
GIT_BEGIN_DECL
38+
639
/**
740
* Get the source specifier
841
*

include/git2/remote.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/*
2+
* This file is free software; you can redistribute it and/or modify
3+
* it under the terms of the GNU General Public License, version 2,
4+
* as published by the Free Software Foundation.
5+
*
6+
* In addition to the permissions in the GNU General Public License,
7+
* the authors give you unlimited permission to link the compiled
8+
* version of this file into combinations with other programs,
9+
* and to distribute those combinations without any restriction
10+
* coming from the use of this file. (The General Public License
11+
* restrictions do apply in other respects; for example, they cover
12+
* modification of the file, and distribution when not linked into
13+
* a combined executable.)
14+
*
15+
* This file is distributed in the hope that it will be useful, but
16+
* WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Public License
21+
* along with this program; see the file COPYING. If not, write to
22+
* the Free Software Foundation, 51 Franklin Street, Fifth Floor,
23+
* Boston, MA 02110-1301, USA.
24+
*/
125
#ifndef INCLUDE_git_remote_h__
226
#define INCLUDE_git_remote_h__
327

@@ -13,6 +37,15 @@
1337
* - _del (needs support from config)
1438
*/
1539

40+
/**
41+
* @file git2/remote.h
42+
* @brief Git remote management
43+
* @defgroup git_remote Git remote management routines
44+
* @ingroup Git
45+
* @{
46+
*/
47+
GIT_BEGIN_DECL
48+
1649
/**
1750
* Get the information for a particular remote
1851
*
@@ -84,4 +117,6 @@ GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs);
84117
*/
85118
GIT_EXTERN(void) git_remote_free(struct git_remote *remote);
86119

120+
GIT_END_DECL
121+
87122
#endif

src/pkt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
* Boston, MA 02110-1301, USA.
2424
*/
2525

26-
#include "git2/pkt.h"
26+
#include "common.h"
27+
2728
#include "git2/types.h"
2829
#include "git2/errors.h"
2930

30-
#include "common.h"
31+
#include "pkt.h"
3132
#include "util.h"
3233
#include "netops.h"
3334

include/git2/pkt.h renamed to src/pkt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
* Boston, MA 02110-1301, USA.
2424
*/
2525

26+
#ifndef INCLUDE_pkt_h__
27+
#define INCLUDE_pkt_h__
28+
29+
#include "common.h"
2630
#include "git2/net.h"
2731

2832
enum git_pkt_type {
@@ -54,3 +58,5 @@ struct git_pkt_ref {
5458
int git_pkt_parse_line(git_pkt **head, const char *line, const char **out, size_t len);
5559
int git_pkt_send_flush(int s);
5660
void git_pkt_free(git_pkt *pkt);
61+
62+
#endif

src/transport_git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
*/
2525

2626
#include "git2/net.h"
27-
#include "git2/pkt.h"
2827
#include "git2/common.h"
2928
#include "git2/types.h"
3029
#include "git2/errors.h"
3130

3231
#include "vector.h"
3332
#include "transport.h"
33+
#include "pkt.h"
3434
#include "common.h"
3535
#include "netops.h"
3636

0 commit comments

Comments
 (0)