diff --git a/src/bin/screens/edi_welcome.c b/src/bin/screens/edi_welcome.c index 5bee799..454f2e4 100644 --- a/src/bin/screens/edi_welcome.c +++ b/src/bin/screens/edi_welcome.c @@ -722,7 +722,7 @@ _edi_welcome_clone_thread_run_cb(void *data, Ecore_Thread *thread EINA_UNUSED) { Edi_Welcome_Data *wd = data; - wd->status = edi_scm_git_clone(wd->url, wd->dir); + wd->status = edi_scm_git_clone(wd->url, wd->dir, EINA_TRUE); } static void diff --git a/src/lib/edi_create.c b/src/lib/edi_create.c index 6549dd9..56349f7 100644 --- a/src/lib/edi_create.c +++ b/src/lib/edi_create.c @@ -406,7 +406,7 @@ edi_create_example(const char *example_name, const char *parentdir, if (ecore_file_exists(examplepath)) status = edi_scm_git_update(examplepath); else - status = edi_scm_git_clone(EXAMPLES_GIT_URL, examplepath); + status = edi_scm_git_clone(EXAMPLES_GIT_URL, examplepath, EINA_FALSE); if (status) { diff --git a/src/lib/edi_scm.c b/src/lib/edi_scm.c index 8c54bae..aed5ec5 100644 --- a/src/lib/edi_scm.c +++ b/src/lib/edi_scm.c @@ -73,12 +73,16 @@ edi_scm_git_new(void) } EAPI int -edi_scm_git_clone(const char *url, const char *dir) +edi_scm_git_clone(const char *url, const char *dir, Eina_Bool history) { int code; Eina_Strbuf *command = eina_strbuf_new(); - eina_strbuf_append_printf(command, "git clone '%s' '%s'", url, dir); + if (history) + eina_strbuf_append_printf(command, "git clone '%s' '%s'", url, dir); + else + eina_strbuf_append_printf(command, "git clone --depth 1 '%s' '%s'", url, dir); + code = edi_exe_wait(eina_strbuf_string_get(command)); eina_strbuf_free(command); diff --git a/src/lib/edi_scm.h b/src/lib/edi_scm.h index aad00a1..dac6ffb 100644 --- a/src/lib/edi_scm.h +++ b/src/lib/edi_scm.h @@ -132,11 +132,13 @@ EAPI int edi_scm_git_new(void); * * @param url The URL to clone from. * @param dir The new directory that will be created to clone into. + * @param history Whether to clone a full git history or single commit. + * * @return The status code of the clone command. * * @ingroup Scm */ -EAPI int edi_scm_git_clone(const char *url, const char *dir); +EAPI int edi_scm_git_clone(const char *url, const char *dir, Eina_Bool history); /** * Update a local git repository from remote source.