summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurence McGlashan <mail@laurencemcglashan.com>2023-03-10 09:30:29 +0000
committerGitHub <noreply@github.com>2023-03-10 09:30:29 +0000
commit79ed94e0f86daae2d839f89789952f0e99eef32a (patch)
treee3187f1b33fd78ca24e1ebaa711705634cc4bf68
parent1cc2979a71ba042c20ea3e18484d4a50c4fdf10d (diff)
downloadlibgit2-79ed94e0f86daae2d839f89789952f0e99eef32a.tar.gz
Apply suggestions from code review
Co-authored-by: Qix <Qix-@users.noreply.github.com>
-rw-r--r--include/git2/remote.h4
-rw-r--r--src/libgit2/transports/smart_protocol.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index f1cee17aa..9e4043f87 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -744,9 +744,9 @@ typedef struct {
git_proxy_options proxy_opts;
/**
- * Depth of the fetch to perform, has to be a positive integer.
+ * Depth of the fetch to perform. Depth <= 0 fetches the full history.
*
- * The default is -1, which will fetch the full history.
+ * The default is -1.
*/
int depth;
diff --git a/src/libgit2/transports/smart_protocol.c b/src/libgit2/transports/smart_protocol.c
index 2ec390101..c37c3cc8d 100644
--- a/src/libgit2/transports/smart_protocol.c
+++ b/src/libgit2/transports/smart_protocol.c
@@ -359,7 +359,7 @@ static int cap_not_sup_err(const char *cap_name)
/* Disables server capabilities we're not interested in */
static int setup_caps(transport_smart_caps *caps, const git_fetch_negotiation *wants)
{
- if (wants->depth) {
+ if (wants->depth > 0) {
if (!caps->shallow)
return cap_not_sup_err(GIT_CAP_SHALLOW);
} else {