summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-05-08 10:17:11 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-05-09 17:14:08 +0100
commit437c5f5a0b6ae6068168081ac6422dba44cff31d (patch)
tree885189c81fd54d00f9bc019033237f41ca989653 /include
parent0a7e32b2326c02a91f9560dfd209e56ea9fb9d49 (diff)
downloadlibgit2-437c5f5a0b6ae6068168081ac6422dba44cff31d.tar.gz
fetch: remove `unshallow` option
The `depth` field is suitable to specify unshallowing; provide an enum to aide in specifying the `unshallow` value.
Diffstat (limited to 'include')
-rw-r--r--include/git2/remote.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 8d6127014..e9065b250 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -702,6 +702,15 @@ typedef enum {
GIT_REMOTE_DOWNLOAD_TAGS_ALL
} git_remote_autotag_option_t;
+/** Constants for fetch depth (shallowness of fetch). */
+typedef enum {
+ /** The fetch is "full" (not shallow). This is the default. */
+ GIT_FETCH_DEPTH_FULL = 0,
+
+ /** The fetch should "unshallow" and fetch missing data. */
+ GIT_FETCH_DEPTH_UNSHALLOW = 2147483647
+} git_fetch_depth_t;
+
/**
* Fetch options structure.
*
@@ -744,20 +753,15 @@ typedef struct {
git_proxy_options proxy_opts;
/**
- * Depth of the fetch to perform, or 0 for full history.
+ * Depth of the fetch to perform, or `GIT_FETCH_DEPTH_FULL`
+ * (or `0`) for full history, or `GIT_FETCH_DEPTH_UNSHALLOW`
+ * to "unshallow" a shallow repository.
*
- * The default is 0.
+ * The default is full (`GIT_FETCH_DEPTH_FULL` or `0`).
*/
int depth;
/**
- * Convert a shallow repository to a full repository.
- *
- * The default is 0, which means the flag is off.
- */
- int unshallow;
-
- /**
* Whether to allow off-site redirects. If this is not
* specified, the `http.followRedirects` configuration setting
* will be consulted.