From fa913c70e32ce6b6d142ac1436ff0d1e61d0dfe3 Mon Sep 17 00:00:00 2001 From: Sandrine Pataut Date: Fri, 26 Dec 2025 11:19:16 +0100 Subject: [PATCH] Add shallow clone --- src/subcommand/clone_subcommand.cpp | 6 ++++ src/subcommand/clone_subcommand.hpp | 3 ++ src/subcommand/fetch_subcommand.cpp | 23 ++++++++++++ src/subcommand/fetch_subcommand.hpp | 9 +++-- src/subcommand/revparse_subcommand.cpp | 7 +++- src/subcommand/revparse_subcommand.hpp | 2 +- src/wrapper/repository_wrapper.cpp | 9 +++-- src/wrapper/repository_wrapper.hpp | 1 + test/test_clone.py | 20 ++++++++--- test/test_remote.py | 48 ++++++++++++++++++++++++++ test/test_revparse.py | 27 +++++++++++---- 11 files changed, 139 insertions(+), 16 deletions(-) diff --git a/src/subcommand/clone_subcommand.cpp b/src/subcommand/clone_subcommand.cpp index 69b44fa..d660ae1 100644 --- a/src/subcommand/clone_subcommand.cpp +++ b/src/subcommand/clone_subcommand.cpp @@ -11,6 +11,9 @@ clone_subcommand::clone_subcommand(const libgit2_object&, CLI::App& app) sub->add_option("", m_repository, "The (possibly remote) repository to clone from.")->required(); sub->add_option("", m_directory, "The name of a new directory to clone into."); + sub->add_option("--depth", m_depth, "Create a shallow clone of that depth."); + // sub->add_option("--shallow-since", m_shallow_since, "