aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.c
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-08-17 13:33:18 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-08-17 13:33:18 -0400
commit78b0952447ee068db8695d688362986945416a62 (patch)
treebfc77a48b826788f9baf03f886a7f790ee9040cc /src/lpm.c
parent627caff603bb194558bd62425db64b085feff4f8 (diff)
downloadlite-xl-plugin-manager-78b0952447ee068db8695d688362986945416a62.tar.gz
lite-xl-plugin-manager-78b0952447ee068db8695d688362986945416a62.zip
Add in preprocessor guard for older libgit2 implementations.
Diffstat (limited to 'src/lpm.c')
-rw-r--r--src/lpm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lpm.c b/src/lpm.c
index 005be6f..855eb4d 100644
--- a/src/lpm.c
+++ b/src/lpm.c
@@ -444,7 +444,9 @@ static int lpm_fetch(lua_State* L) {
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL;
fetch_opts.callbacks.payload = L;
- fetch_opts.depth = 1;
+ #if LIBGIT2_VER_MAJOR >= 1 && LIBGIT2_VER_MINOR >= 7
+ fetch_opts.depth = 1;
+ #endif
if (no_verify_ssl)
fetch_opts.callbacks.certificate_check = lpm_git_transport_certificate_check_cb;
if (lua_type(L, 2) == LUA_TFUNCTION)