Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF ()

FIND_PACKAGE(OpenSSL)
IF (OPENSSL_FOUND)
ADD_DEFINITIONS(-DGIT_SSL)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES})
ENDIF()

IF (THREADSAFE)
IF (NOT WIN32)
find_package(Threads REQUIRED)
Expand Down Expand Up @@ -118,7 +125,7 @@ ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
TARGET_LINK_LIBRARIES(git2 socket nsl)
ENDIF ()

TARGET_LINK_LIBRARIES(git2 ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(git2 ${CMAKE_THREAD_LIBS_INIT} ${SSL_LIBRARIES})
SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY)
Expand Down Expand Up @@ -154,7 +161,7 @@ IF (BUILD_CLAR)
WORKING_DIRECTORY ${CLAR_PATH}
)
ADD_EXECUTABLE(libgit2_clar ${SRC} ${CLAR_PATH}/clar_main.c ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX})
TARGET_LINK_LIBRARIES(libgit2_clar ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(libgit2_clar ${CMAKE_THREAD_LIBS_INIT} ${SSL_LIBRARIES})
IF (WIN32)
TARGET_LINK_LIBRARIES(libgit2_clar ws2_32)
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
Expand Down
1 change: 1 addition & 0 deletions include/git2/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ typedef enum {
GITERR_TAG,
GITERR_TREE,
GITERR_INDEXER,
GITERR_SSL,
} git_error_t;

/**
Expand Down
9 changes: 9 additions & 0 deletions include/git2/remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ GIT_EXTERN(int) git_remote_list(git_strarray *remotes_list, git_repository *repo
*/
GIT_EXTERN(int) git_remote_add(git_remote **out, git_repository *repo, const char *name, const char *url);

/**
* Choose whether to check the server's certificate (applies to HTTPS only)
*
* @param remote the remote to configure
* @param check whether to check the server's certificate (defaults to yes)
*/

GIT_EXTERN(void) git_remote_check_cert(git_remote *remote, int check);

/** @} */
GIT_END_DECL
#endif
1 change: 0 additions & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ void giterr_clear(void);
void giterr_set_str(int error_class, const char *string);
void giterr_set_regex(const regex_t *regex, int error_code);


#include "util.h"


Expand Down
4 changes: 2 additions & 2 deletions src/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_st
int git_fetch__download_pack(
const char *buffered,
size_t buffered_size,
GIT_SOCKET fd,
git_transport *t,
git_repository *repo,
git_off_t *bytes,
git_indexer_stats *stats)
Expand All @@ -120,7 +120,7 @@ int git_fetch__download_pack(
gitno_buffer buf;
git_indexer_stream *idx;

gitno_buffer_setup(&buf, buff, sizeof(buff), fd);
gitno_buffer_setup(t, &buf, buff, sizeof(buff));

if (memcmp(buffered, "PACK", strlen("PACK"))) {
giterr_set(GITERR_NET, "The pack doesn't start with the signature");
Expand Down
2 changes: 1 addition & 1 deletion src/fetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
int git_fetch_negotiate(git_remote *remote);
int git_fetch_download_pack(git_remote *remote, git_off_t *bytes, git_indexer_stats *stats);

int git_fetch__download_pack(const char *buffered, size_t buffered_size, GIT_SOCKET fd,
int git_fetch__download_pack(const char *buffered, size_t buffered_size, git_transport *t,
git_repository *repo, git_off_t *bytes, git_indexer_stats *stats);
int git_fetch_setup_walk(git_revwalk **out, git_repository *repo);

Expand Down
Loading