1 /* 2 * Copyright (C) the libgit2 contributors. All rights reserved. 3 * 4 * This file is part of libgit2, distributed under the GNU GPL v2 with 5 * a Linking Exception. For full terms see the included COPYING file. 6 */ 7 #ifndef INCLUDE_git_net_h__ 8 #define INCLUDE_git_net_h__ 9 10 #include "common.h" 11 #include "oid.h" 12 #include "types.h" 13 14 /** 15 * @file git2/net.h 16 * @brief Git networking declarations 17 * @ingroup Git 18 * @{ 19 */ 20 GIT_BEGIN_DECL 21 22 #define GIT_DEFAULT_PORT "9418" 23 24 /** 25 * Direction of the connection. 26 * 27 * We need this because we need to know whether we should call 28 * git-upload-pack or git-receive-pack on the remote end when get_refs 29 * gets called. 30 */ 31 typedef enum { 32 GIT_DIRECTION_FETCH = 0, 33 GIT_DIRECTION_PUSH = 1 34 } git_direction; 35 36 /** 37 * Description of a reference advertised by a remote server, given out 38 * on `ls` calls. 39 */ 40 struct git_remote_head { 41 int local; /* available locally */ 42 git_oid oid; 43 git_oid loid; 44 char *name; 45 /** 46 * If the server send a symref mapping for this ref, this will 47 * point to the target. 48 */ 49 char *symref_target; 50 }; 51 52 /** @} */ 53 GIT_END_DECL 54 #endif 55