summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/diff.h19
-rw-r--r--include/git2/filter.h37
-rw-r--r--include/git2/remote.h10
-rw-r--r--include/git2/submodule.h11
-rw-r--r--include/git2/sys/filter.h5
-rw-r--r--include/git2/transport.h35
6 files changed, 81 insertions, 36 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index b3ab5397e..0abbc7f06 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -836,6 +836,25 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index(
const git_diff_options *opts); /**< can be NULL for defaults */
/**
+ * Create a diff with the difference between two index objects.
+ *
+ * The first index will be used for the "old_file" side of the delta and the
+ * second index will be used for the "new_file" side of the delta.
+ *
+ * @param diff Output pointer to a git_diff pointer to be allocated.
+ * @param repo The repository containing the indexes.
+ * @param old_index A git_index object to diff from.
+ * @param new_index A git_index object to diff to.
+ * @param opts Structure with options to influence diff or NULL for defaults.
+ */
+GIT_EXTERN(int) git_diff_index_to_index(
+ git_diff **diff,
+ git_repository *repo,
+ git_index *old_index,
+ git_index *new_index,
+ const git_diff_options *opts); /**< can be NULL for defaults */
+
+/**
* Merge one diff into another.
*
* This merges items from the "from" list into the "onto" list. The
diff --git a/include/git2/filter.h b/include/git2/filter.h
index 1828903e4..436a0f3c8 100644
--- a/include/git2/filter.h
+++ b/include/git2/filter.h
@@ -137,7 +137,13 @@ GIT_EXTERN(int) git_filter_list_apply_to_data(
git_buf *in);
/**
- * Apply filter list to the contents of a file on disk
+ * Apply a filter list to the contents of a file on disk
+ *
+ * @param out buffer into which to store the filtered file
+ * @param filters the list of filters to apply
+ * @param repo the repository in which to perform the filtering
+ * @param path the path of the file to filter, a relative path will be
+ * taken as relative to the workdir
*/
GIT_EXTERN(int) git_filter_list_apply_to_file(
git_buf *out,
@@ -146,24 +152,51 @@ GIT_EXTERN(int) git_filter_list_apply_to_file(
const char *path);
/**
- * Apply filter list to the contents of a blob
+ * Apply a filter list to the contents of a blob
+ *
+ * @param out buffer into which to store the filtered file
+ * @param filters the list of filters to apply
+ * @param blob the blob to filter
*/
GIT_EXTERN(int) git_filter_list_apply_to_blob(
git_buf *out,
git_filter_list *filters,
git_blob *blob);
+/**
+ * Apply a filter list to an arbitrary buffer as a stream
+ *
+ * @param filters the list of filters to apply
+ * @param data the buffer to filter
+ * @param target the stream into which the data will be written
+ */
GIT_EXTERN(int) git_filter_list_stream_data(
git_filter_list *filters,
git_buf *data,
git_writestream *target);
+/**
+ * Apply a filter list to a file as a stream
+ *
+ * @param filters the list of filters to apply
+ * @param repo the repository in which to perform the filtering
+ * @param path the path of the file to filter, a relative path will be
+ * taken as relative to the workdir
+ * @param target the stream into which the data will be written
+ */
GIT_EXTERN(int) git_filter_list_stream_file(
git_filter_list *filters,
git_repository *repo,
const char *path,
git_writestream *target);
+/**
+ * Apply a filter list to a blob as a stream
+ *
+ * @param filters the list of filters to apply
+ * @param blob the blob to filter
+ * @param target the stream into which the data will be written
+ */
GIT_EXTERN(int) git_filter_list_stream_blob(
git_filter_list *filters,
git_blob *blob,
diff --git a/include/git2/remote.h b/include/git2/remote.h
index e47f00881..444fe5276 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -511,6 +511,14 @@ typedef enum {
GIT_REMOTE_DOWNLOAD_TAGS_ALL,
} git_remote_autotag_option_t;
+/**
+ * Fetch options structure.
+ *
+ * Zero out for defaults. Initialize with `GIT_FETCH_OPTIONS_INIT` macro to
+ * correctly set the `version` field. E.g.
+ *
+ * git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
+ */
typedef struct {
int version;
@@ -739,7 +747,7 @@ GIT_EXTERN(int) git_remote_prune_refs(const git_remote *remote);
* stored here for further processing by the caller. Always free this
* strarray on successful return.
* @param repo the repository in which to rename
- * @param name the current name of the reamote
+ * @param name the current name of the remote
* @param new_name the new name the remote should bear
* @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
*/
diff --git a/include/git2/submodule.h b/include/git2/submodule.h
index cbafccd1b..689fe4b64 100644
--- a/include/git2/submodule.h
+++ b/include/git2/submodule.h
@@ -584,17 +584,6 @@ GIT_EXTERN(int) git_submodule_open(
GIT_EXTERN(int) git_submodule_reload(git_submodule *submodule, int force);
/**
- * Reread all submodule info.
- *
- * Call this to reload all cached submodule information for the repo.
- *
- * @param repo The repository to reload submodule data for
- * @param force Force full reload even if the data doesn't seem out of date
- * @return 0 on success, <0 on error
- */
-GIT_EXTERN(int) git_submodule_reload_all(git_repository *repo, int force);
-
-/**
* Get the status for a submodule.
*
* This looks at a submodule and tries to determine the status. It
diff --git a/include/git2/sys/filter.h b/include/git2/sys/filter.h
index 5fd8d5566..baf1515d6 100644
--- a/include/git2/sys/filter.h
+++ b/include/git2/sys/filter.h
@@ -240,7 +240,10 @@ typedef void (*git_filter_cleanup_fn)(
* for this filter (e.g. "eol crlf text"). If the attribute name is bare,
* it will be simply loaded and passed to the `check` callback. If it has
* a value (i.e. "name=value"), the attribute must match that value for
- * the filter to be applied.
+ * the filter to be applied. The value may be a wildcard (eg, "name=*"),
+ * in which case the filter will be invoked for any value for the given
+ * attribute name. See the attribute parameter of the `check` callback
+ * for the attribute value that was specified.
*
* The `initialize`, `shutdown`, `check`, `apply`, and `cleanup` callbacks
* are all documented above with the respective function pointer typedefs.
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 2eeebd565..fd55eac0a 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -37,39 +37,32 @@ typedef enum {
* Hostkey information taken from libssh2
*/
typedef struct {
+ git_cert parent;
+
/**
- * Type of certificate. Here to share the header with
- * `git_cert`.
+ * A hostkey type from libssh2, either
+ * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
*/
- git_cert_t cert_type;
- /**
- * A hostkey type from libssh2, either
- * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
- */
git_cert_ssh_t type;
- /**
- * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
- * have the MD5 hash of the hostkey.
- */
+ /**
+ * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
+ * have the MD5 hash of the hostkey.
+ */
unsigned char hash_md5[16];
- /**
- * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
- * have the SHA-1 hash of the hostkey.
- */
- unsigned char hash_sha1[20];
+ /**
+ * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
+ * have the SHA-1 hash of the hostkey.
+ */
+ unsigned char hash_sha1[20];
} git_cert_hostkey;
/**
* X.509 certificate information
*/
typedef struct {
- /**
- * Type of certificate. Here to share the header with
- * `git_cert`.
- */
- git_cert_t cert_type;
+ git_cert parent;
/**
* Pointer to the X.509 certificate data
*/