Skip to content

Commit df07586

Browse files
committed
OpenCOR: allow cloning in a non-empty directory.
1 parent b7bad55 commit df07586

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

include/git2/clone.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ GIT_EXTERN(int) git_clone(
202202
git_repository **out,
203203
const char *url,
204204
const char *local_path,
205-
const git_clone_options *options);
205+
const git_clone_options *options,
206+
int use_existing);
206207

207208
/** @} */
208209
GIT_END_DECL

src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ IF(USE_BUNDLED_ZLIB STREQUAL "OFF")
207207
IF(ZLIB_FOUND)
208208
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${ZLIB_INCLUDE_DIRS})
209209
LIST(APPEND LIBGIT2_LIBS ${ZLIB_LIBRARIES})
210-
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
211-
LIST(APPEND LIBGIT2_PC_LIBS "-lz")
212-
ELSE()
213-
LIST(APPEND LIBGIT2_PC_REQUIRES "zlib")
214-
ENDIF()
215210
ADD_FEATURE_INFO(zlib ON "using system zlib")
216211
ELSE()
217212
MESSAGE(STATUS "zlib was not found; using bundled 3rd-party sources." )

src/clone.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,10 @@ int git_clone(
530530
git_repository **out,
531531
const char *url,
532532
const char *local_path,
533-
const git_clone_options *_options)
533+
const git_clone_options *_options,
534+
int use_existing)
534535
{
535-
return git__clone(out, url, local_path, _options, 0);
536+
return git__clone(out, url, local_path, _options, use_existing);
536537
}
537538

538539
int git_clone__submodule(

src/submodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
13771377
*/
13781378
clone_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE;
13791379

1380-
if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options)) < 0 ||
1380+
if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options, 0)) < 0 ||
13811381
(error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm))) < 0 ||
13821382
(error = git_checkout_head(sub_repo, &update_options.checkout_opts)) != 0)
13831383
goto done;

0 commit comments

Comments
 (0)