summaryrefslogtreecommitdiff
path: root/src/clone.c
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-06-21 11:13:19 -0700
committerBen Straub <bstraub@github.com>2012-06-21 11:13:19 -0700
commit14741d62d9a8ae79774cf891a7ed665d8d650188 (patch)
treea896a5e1e65c52d75b50aece56ec057cba54f32d /src/clone.c
parent941611153a497ddfe454e07c48584b7e23bf484a (diff)
downloadlibgit2-14741d62d9a8ae79774cf891a7ed665d8d650188.tar.gz
Clone: new home for git_checkout_force.
Diffstat (limited to 'src/clone.c')
-rw-r--r--src/clone.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/clone.c b/src/clone.c
index 7ae3c1447..cc20b971b 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -12,12 +12,12 @@
#include "git2/revparse.h"
#include "git2/branch.h"
#include "git2/config.h"
+#include "git2/checkout.h"
#include "common.h"
#include "remote.h"
#include "fileops.h"
#include "refs.h"
-// TODO #include "checkout.h"
GIT_BEGIN_DECL
@@ -27,14 +27,6 @@ struct HeadInfo {
git_buf branchname;
};
-static int git_checkout_force(git_repository *repo)
-{
- /* TODO
- * -> Line endings
- */
- return 0;
-}
-
static int create_tracking_branch(git_repository *repo, git_oid *target, const char *name)
{
git_object *head_obj = NULL;
@@ -214,6 +206,7 @@ int git_clone_bare(git_repository **out,
const char *dest_path,
git_indexer_stats *stats)
{
+ assert(out && origin_url && dest_path);
return clone_internal(out, origin_url, dest_path, stats, 1);
}
@@ -225,8 +218,11 @@ int git_clone(git_repository **out,
{
int retcode = GIT_ERROR;
+ assert(out && origin_url && workdir_path);
+
if (!(retcode = clone_internal(out, origin_url, workdir_path, stats, 0))) {
- retcode = git_checkout_force(*out);
+ git_indexer_stats checkout_stats;
+ retcode = git_checkout_force(*out, &checkout_stats);
}
return retcode;