diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 8139a05712e..f5983111657 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -328,6 +328,8 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this std::vector> getSubmodules(const Hash & rev, bool exportIgnore) override; + void smudgeLfs() override; + std::string resolveSubmoduleUrl(const std::string & url) override { git_buf buf = GIT_BUF_INIT; @@ -1103,8 +1105,8 @@ std::vector> GitRepoImpl::getSubmodules } void GitRepoImpl::smudgeLfs() { - const auto metadatas = lfs::parse_lfs_files(this->repo); - const auto [url, host, path] = lfs::get_lfs_endpoint_url(this->repo); + const auto metadatas = lfs::parse_lfs_files(&(*repo)); + const auto [url, host, path] = lfs::get_lfs_endpoint_url(&(*repo)); // TODO: handle public lfs repos without ssh? const auto token = lfs::get_lfs_api_token(host, path); auto urls = lfs::fetch_urls(url, token, metadatas); diff --git a/src/libfetchers/git-utils.hh b/src/libfetchers/git-utils.hh index c75270eb97f..4b7a7e733b8 100644 --- a/src/libfetchers/git-utils.hh +++ b/src/libfetchers/git-utils.hh @@ -74,10 +74,6 @@ struct GitRepo virtual std::string resolveSubmoduleUrl(const std::string & url) = 0; - virtual std::string resolveSubmoduleUrl( - const std::string & url, - const std::string & base) = 0; - virtual bool hasObject(const Hash & oid) = 0; virtual ref getAccessor(const Hash & rev, bool exportIgnore) = 0; diff --git a/src/libfetchers/local.mk b/src/libfetchers/local.mk index e229a099353..a3e6a3d7517 100644 --- a/src/libfetchers/local.mk +++ b/src/libfetchers/local.mk @@ -12,6 +12,6 @@ INCLUDE_libfetchers := -I $(d) libfetchers_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libfetchers) -libfetchers_LDFLAGS += $(THREAD_LDFLAGS) $(LIBGIT2_LIBS) -larchive +libfetchers_LDFLAGS += $(THREAD_LDFLAGS) $(LIBGIT2_LIBS) $(LIBCURL_LIBS) -larchive libfetchers_LIBS = libutil libstore diff --git a/src/libfetchers/meson.build b/src/libfetchers/meson.build index 5a409ed7d61..2d8df4be978 100644 --- a/src/libfetchers/meson.build +++ b/src/libfetchers/meson.build @@ -34,6 +34,9 @@ deps_public += nlohmann_json libgit2 = dependency('libgit2') deps_private += libgit2 +curl = dependency('libcurl', 'curl') +deps_private += curl + add_project_arguments( # TODO(Qyriad): Yes this is how the autoconf+Make system did it. # It would be nice for our headers to be idempotent instead.