aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.c
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2024-06-09 13:29:49 -0400
committerAdam Harrison <adamdharrison@gmail.com>2024-06-09 13:29:49 -0400
commit6e33089dff1bcc2919c51decca7471c32c83a46e (patch)
treec630daf25c53a06c34bb3a031f85e9d3222ce1c5 /src/lpm.c
parent259331a015432cfd47eb5c6161c6ddf05288a01c (diff)
downloadlite-xl-plugin-manager-6e33089dff1bcc2919c51decca7471c32c83a46e.tar.gz
lite-xl-plugin-manager-6e33089dff1bcc2919c51decca7471c32c83a46e.zip
Added in fallback to fetch everything if we can't find a specific object.
Diffstat (limited to 'src/lpm.c')
-rw-r--r--src/lpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lpm.c b/src/lpm.c
index ca0c015..15af8c2 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -483,12 +483,12 @@ static int lpm_fetch(lua_State* L) {
git_repository_free(repository);
return luaL_error(L, "git remote fetch error: %s", git_error_last_string());
}
- const char* refspec = lua_gettop(L) >= 3 ? luaL_checkstring(L, 3) : NULL;
+ const char* refspec = luaL_optstring(L, 3, NULL);
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL;
fetch_opts.callbacks.payload = L;
#if (LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 7) || LIBGIT2_VER_MAJOR > 1
- fetch_opts.depth = 1;
+ fetch_opts.depth = lua_toboolean(L, 4) ? GIT_FETCH_DEPTH_FULL : 1;
#endif
if (no_verify_ssl)
fetch_opts.callbacks.certificate_check = lpm_git_transport_certificate_check_cb;