Add shallow clone support#69
Merged
Merged
Conversation
Due to the upgrade to zig 0.16.0 there was memory leak introduced when cloning to temporary directories, and a panic when the GARB_PATH was set. Signed-off-by: Jim Fitzpatrick <jimfity@gmail.com>
New flag added to allow the shallow cloning of repos. Signed-off-by: Jim Fitzpatrick <jimfity@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #68
Overview
Introduces the ability to perform shallow clones with a depth of one, significantly improving clone speed when full commit history is not required. This is particularly useful when cloning to temporary directories for quick operations.
Implementation
The
-S/--shallowflag has been added to enable shallow cloning. When set, the clone operation uses--depth=1, fetching only the latest commit without history.How Acceptance Criteria is Met
The issue requested a clone depth flag to improve clone performance. The implementation addresses this by:
-S/--shallowflag triggers a depth-1 clone, eliminating unnecessary history transferNote: The current implementation uses a boolean flag for depth-1 clones rather than accepting arbitrary depth values. This simplifies the interface while addressing the primary use case of fast clones without history.
Usage
Additional Changes
Fixed a memory leak in the Configuration cleanup logic by properly freeing allocated path strings in the deinit method.