mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(repository): add ability to pass credentials in callbacks argument
This commit is contained in:
parent
299d1a17e7
commit
4c7a096fe3
31 changed files with 1340 additions and 308 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "git2/deprecated.h"
|
||||
#include "git2/describe.h"
|
||||
#include "git2/diff.h"
|
||||
#include "git2/email.h"
|
||||
#include "git2/errors.h"
|
||||
#include "git2/filter.h"
|
||||
#include "git2/global.h"
|
||||
|
|
|
@ -147,11 +147,17 @@ typedef struct {
|
|||
/** A combination of GIT_ATTR_CHECK flags */
|
||||
unsigned int flags;
|
||||
|
||||
#ifdef GIT_DEPRECATE_HARD
|
||||
void *reserved;
|
||||
#else
|
||||
git_oid *commit_id;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The commit to load attributes from, when
|
||||
* `GIT_ATTR_CHECK_INCLUDE_COMMIT` is specified.
|
||||
*/
|
||||
git_oid *commit_id;
|
||||
git_oid attr_commit_id;
|
||||
} git_attr_options;
|
||||
|
||||
#define GIT_ATTR_OPTIONS_VERSION 1
|
||||
|
|
|
@ -135,11 +135,17 @@ typedef struct {
|
|||
/** Flags to control the filtering process, see `git_blob_filter_flag_t` above */
|
||||
uint32_t flags;
|
||||
|
||||
#ifdef GIT_DEPRECATE_HARD
|
||||
void *reserved;
|
||||
#else
|
||||
git_oid *commit_id;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The commit to load attributes from, when
|
||||
* `GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
|
||||
*/
|
||||
git_oid *commit_id;
|
||||
git_oid attr_commit_id;
|
||||
} git_blob_filter_options;
|
||||
|
||||
#define GIT_BLOB_FILTER_OPTIONS_VERSION 1
|
||||
|
|
|
@ -133,7 +133,7 @@ typedef struct git_clone_options {
|
|||
* The name of the branch to checkout. NULL means use the
|
||||
* remote's default branch.
|
||||
*/
|
||||
const char* checkout_branch;
|
||||
const char *checkout_branch;
|
||||
|
||||
/**
|
||||
* A callback used to create the new repository into which to
|
||||
|
|
|
@ -209,7 +209,9 @@ typedef enum {
|
|||
GIT_OPT_GET_MWINDOW_FILE_LIMIT,
|
||||
GIT_OPT_SET_MWINDOW_FILE_LIMIT,
|
||||
GIT_OPT_SET_ODB_PACKED_PRIORITY,
|
||||
GIT_OPT_SET_ODB_LOOSE_PRIORITY
|
||||
GIT_OPT_SET_ODB_LOOSE_PRIORITY,
|
||||
GIT_OPT_GET_EXTENSIONS,
|
||||
GIT_OPT_SET_EXTENSIONS
|
||||
} git_libgit2_opt_t;
|
||||
|
||||
/**
|
||||
|
@ -431,6 +433,22 @@ typedef enum {
|
|||
* > Override the default priority of the loose ODB backend which
|
||||
* > is added when default backends are assigned to a repository
|
||||
*
|
||||
* opts(GIT_OPT_GET_EXTENSIONS, git_strarray *out)
|
||||
* > Returns the list of git extensions that are supported. This
|
||||
* > is the list of built-in extensions supported by libgit2 and
|
||||
* > custom extensions that have been added with
|
||||
* > `GIT_OPT_SET_EXTENSIONS`. Extensions that have been negated
|
||||
* > will not be returned. The returned list should be released
|
||||
* > with `git_strarray_dispose`.
|
||||
*
|
||||
* opts(GIT_OPT_SET_EXTENSIONS, const char **extensions, size_t len)
|
||||
* > Set that the given git extensions are supported by the caller.
|
||||
* > Extensions supported by libgit2 may be negated by prefixing
|
||||
* > them with a `!`. For example: setting extensions to
|
||||
* > { "!noop", "newext" } indicates that the caller does not want
|
||||
* > to support repositories with the `noop` extension but does want
|
||||
* > to support repositories with the `newext` extension.
|
||||
*
|
||||
* @param option Option key
|
||||
* @param ... value to set the option
|
||||
* @return 0 on success, <0 on failure
|
||||
|
|
|
@ -294,6 +294,102 @@ typedef git_configmap git_cvar_map;
|
|||
|
||||
/**@}*/
|
||||
|
||||
/** @name Deprecated Diff Functions and Constants
|
||||
*
|
||||
* These functions and enumeration values are retained for backward
|
||||
* compatibility. The newer versions of these functions and values
|
||||
* should be preferred in all new code.
|
||||
*
|
||||
* There is no plan to remove these backward compatibility values at
|
||||
* this time.
|
||||
*/
|
||||
/**@{*/
|
||||
|
||||
/**
|
||||
* Formatting options for diff e-mail generation
|
||||
*/
|
||||
typedef enum {
|
||||
/** Normal patch, the default */
|
||||
GIT_DIFF_FORMAT_EMAIL_NONE = 0,
|
||||
|
||||
/** Don't insert "[PATCH]" in the subject header*/
|
||||
GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0),
|
||||
|
||||
} git_diff_format_email_flags_t;
|
||||
|
||||
/**
|
||||
* Options for controlling the formatting of the generated e-mail.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int version;
|
||||
|
||||
/** see `git_diff_format_email_flags_t` above */
|
||||
uint32_t flags;
|
||||
|
||||
/** This patch number */
|
||||
size_t patch_no;
|
||||
|
||||
/** Total number of patches in this series */
|
||||
size_t total_patches;
|
||||
|
||||
/** id to use for the commit */
|
||||
const git_oid *id;
|
||||
|
||||
/** Summary of the change */
|
||||
const char *summary;
|
||||
|
||||
/** Commit message's body */
|
||||
const char *body;
|
||||
|
||||
/** Author of the change */
|
||||
const git_signature *author;
|
||||
} git_diff_format_email_options;
|
||||
|
||||
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
|
||||
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
|
||||
|
||||
/**
|
||||
* Create an e-mail ready patch from a diff.
|
||||
*
|
||||
* @deprecated git_email_create_from_diff
|
||||
* @see git_email_create_from_diff
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_format_email(
|
||||
git_buf *out,
|
||||
git_diff *diff,
|
||||
const git_diff_format_email_options *opts);
|
||||
|
||||
/**
|
||||
* Create an e-mail ready patch for a commit.
|
||||
*
|
||||
* @deprecated git_email_create_from_commit
|
||||
* @see git_email_create_from_commit
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_commit_as_email(
|
||||
git_buf *out,
|
||||
git_repository *repo,
|
||||
git_commit *commit,
|
||||
size_t patch_no,
|
||||
size_t total_patches,
|
||||
uint32_t flags,
|
||||
const git_diff_options *diff_opts);
|
||||
|
||||
/**
|
||||
* Initialize git_diff_format_email_options structure
|
||||
*
|
||||
* Initializes a `git_diff_format_email_options` with default values. Equivalent
|
||||
* to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
|
||||
*
|
||||
* @param opts The `git_blame_options` struct to initialize.
|
||||
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
|
||||
* @return Zero on success; -1 on failure.
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_format_email_options_init(
|
||||
git_diff_format_email_options *opts,
|
||||
unsigned int version);
|
||||
|
||||
/**@}*/
|
||||
|
||||
/** @name Deprecated Error Functions and Constants
|
||||
*
|
||||
* These functions and enumeration values are retained for backward
|
||||
|
@ -683,6 +779,30 @@ GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
|
|||
|
||||
/**@}*/
|
||||
|
||||
/** @name Deprecated OID Array Functions
|
||||
*
|
||||
* These types are retained for backward compatibility. The newer
|
||||
* versions of these values should be preferred in all new code.
|
||||
*
|
||||
* There is no plan to remove these backward compatibility values at
|
||||
* this time.
|
||||
*/
|
||||
/**@{*/
|
||||
|
||||
/**
|
||||
* Free the memory referred to by the git_oidarray. This is an alias of
|
||||
* `git_oidarray_dispose` and is preserved for backward compatibility.
|
||||
*
|
||||
* This function is deprecated, but there is no plan to remove this
|
||||
* function at this time.
|
||||
*
|
||||
* @deprecated Use git_oidarray_dispose
|
||||
* @see git_oidarray_dispose
|
||||
*/
|
||||
GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
|
||||
|
||||
/**@}*/
|
||||
|
||||
/** @name Deprecated Transfer Progress Types
|
||||
*
|
||||
* These types are retained for backward compatibility. The newer
|
||||
|
|
|
@ -133,6 +133,9 @@ typedef enum {
|
|||
*/
|
||||
GIT_DIFF_INDENT_HEURISTIC = (1u << 18),
|
||||
|
||||
/** Ignore blank lines */
|
||||
GIT_DIFF_IGNORE_BLANK_LINES = (1u << 19),
|
||||
|
||||
/** Treat all files as text, disabling binary attributes & detection */
|
||||
GIT_DIFF_FORCE_TEXT = (1u << 20),
|
||||
/** Treat all files as binary, disabling text diffs */
|
||||
|
@ -168,10 +171,6 @@ typedef enum {
|
|||
* can apply given diff information to binary files.
|
||||
*/
|
||||
GIT_DIFF_SHOW_BINARY = (1u << 30),
|
||||
|
||||
/** Ignore blank lines */
|
||||
GIT_DIFF_IGNORE_BLANK_LINES = (1u << 31),
|
||||
|
||||
} git_diff_option_t;
|
||||
|
||||
/**
|
||||
|
@ -1376,99 +1375,6 @@ GIT_EXTERN(int) git_diff_stats_to_buf(
|
|||
*/
|
||||
GIT_EXTERN(void) git_diff_stats_free(git_diff_stats *stats);
|
||||
|
||||
/**
|
||||
* Formatting options for diff e-mail generation
|
||||
*/
|
||||
typedef enum {
|
||||
/** Normal patch, the default */
|
||||
GIT_DIFF_FORMAT_EMAIL_NONE = 0,
|
||||
|
||||
/** Don't insert "[PATCH]" in the subject header*/
|
||||
GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0),
|
||||
|
||||
} git_diff_format_email_flags_t;
|
||||
|
||||
/**
|
||||
* Options for controlling the formatting of the generated e-mail.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int version;
|
||||
|
||||
/** see `git_diff_format_email_flags_t` above */
|
||||
uint32_t flags;
|
||||
|
||||
/** This patch number */
|
||||
size_t patch_no;
|
||||
|
||||
/** Total number of patches in this series */
|
||||
size_t total_patches;
|
||||
|
||||
/** id to use for the commit */
|
||||
const git_oid *id;
|
||||
|
||||
/** Summary of the change */
|
||||
const char *summary;
|
||||
|
||||
/** Commit message's body */
|
||||
const char *body;
|
||||
|
||||
/** Author of the change */
|
||||
const git_signature *author;
|
||||
} git_diff_format_email_options;
|
||||
|
||||
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
|
||||
#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
|
||||
|
||||
/**
|
||||
* Create an e-mail ready patch from a diff.
|
||||
*
|
||||
* @param out buffer to store the e-mail patch in
|
||||
* @param diff containing the commit
|
||||
* @param opts structure with options to influence content and formatting.
|
||||
* @return 0 or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_format_email(
|
||||
git_buf *out,
|
||||
git_diff *diff,
|
||||
const git_diff_format_email_options *opts);
|
||||
|
||||
/**
|
||||
* Create an e-mail ready patch for a commit.
|
||||
*
|
||||
* Does not support creating patches for merge commits (yet).
|
||||
*
|
||||
* @param out buffer to store the e-mail patch in
|
||||
* @param repo containing the commit
|
||||
* @param commit pointer to up commit
|
||||
* @param patch_no patch number of the commit
|
||||
* @param total_patches total number of patches in the patch set
|
||||
* @param flags determines the formatting of the e-mail
|
||||
* @param diff_opts structure with options to influence diff or NULL for defaults.
|
||||
* @return 0 or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_commit_as_email(
|
||||
git_buf *out,
|
||||
git_repository *repo,
|
||||
git_commit *commit,
|
||||
size_t patch_no,
|
||||
size_t total_patches,
|
||||
uint32_t flags,
|
||||
const git_diff_options *diff_opts);
|
||||
|
||||
/**
|
||||
* Initialize git_diff_format_email_options structure
|
||||
*
|
||||
* Initializes a `git_diff_format_email_options` with default values. Equivalent
|
||||
* to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
|
||||
*
|
||||
* @param opts The `git_blame_options` struct to initialize.
|
||||
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
|
||||
* @return Zero on success; -1 on failure.
|
||||
*/
|
||||
GIT_EXTERN(int) git_diff_format_email_options_init(
|
||||
git_diff_format_email_options *opts,
|
||||
unsigned int version);
|
||||
|
||||
/**
|
||||
* Patch ID options structure
|
||||
*
|
||||
|
|
127
libgit2/headers/git2/email.h
Normal file
127
libgit2/headers/git2/email.h
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright (C) the libgit2 contributors. All rights reserved.
|
||||
*
|
||||
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
||||
* a Linking Exception. For full terms see the included COPYING file.
|
||||
*/
|
||||
#ifndef INCLUDE_git_email_h__
|
||||
#define INCLUDE_git_email_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/**
|
||||
* @file git2/email.h
|
||||
* @brief Git email formatting and application routines.
|
||||
* @ingroup Git
|
||||
* @{
|
||||
*/
|
||||
GIT_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Formatting options for diff e-mail generation
|
||||
*/
|
||||
typedef enum {
|
||||
/** Normal patch, the default */
|
||||
GIT_EMAIL_CREATE_DEFAULT = 0,
|
||||
|
||||
/** Do not include patch numbers in the subject prefix. */
|
||||
GIT_EMAIL_CREATE_OMIT_NUMBERS = (1u << 0),
|
||||
|
||||
/**
|
||||
* Include numbers in the subject prefix even when the
|
||||
* patch is for a single commit (1/1).
|
||||
*/
|
||||
GIT_EMAIL_CREATE_ALWAYS_NUMBER = (1u << 1),
|
||||
|
||||
/** Do not perform rename or similarity detection. */
|
||||
GIT_EMAIL_CREATE_NO_RENAMES = (1u << 2),
|
||||
} git_email_create_flags_t;
|
||||
|
||||
/**
|
||||
* Options for controlling the formatting of the generated e-mail.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int version;
|
||||
|
||||
/** see `git_email_create_flags_t` above */
|
||||
uint32_t flags;
|
||||
|
||||
/** Options to use when creating diffs */
|
||||
git_diff_options diff_opts;
|
||||
|
||||
/** Options for finding similarities within diffs */
|
||||
git_diff_find_options diff_find_opts;
|
||||
|
||||
/**
|
||||
* The subject prefix, by default "PATCH". If set to an empty
|
||||
* string ("") then only the patch numbers will be shown in the
|
||||
* prefix. If the subject_prefix is empty and patch numbers
|
||||
* are not being shown, the prefix will be omitted entirely.
|
||||
*/
|
||||
const char *subject_prefix;
|
||||
|
||||
/**
|
||||
* The starting patch number; this cannot be 0. By default,
|
||||
* this is 1.
|
||||
*/
|
||||
size_t start_number;
|
||||
|
||||
/** The "re-roll" number. By default, there is no re-roll. */
|
||||
size_t reroll_number;
|
||||
} git_email_create_options;
|
||||
|
||||
/*
|
||||
* By default, our options include rename detection and binary
|
||||
* diffs to match `git format-patch`.
|
||||
*/
|
||||
#define GIT_EMAIL_CREATE_OPTIONS_VERSION 1
|
||||
#define GIT_EMAIL_CREATE_OPTIONS_INIT \
|
||||
{ \
|
||||
GIT_EMAIL_CREATE_OPTIONS_VERSION, \
|
||||
GIT_EMAIL_CREATE_DEFAULT, \
|
||||
{ GIT_DIFF_OPTIONS_VERSION, GIT_DIFF_SHOW_BINARY, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3 }, \
|
||||
GIT_DIFF_FIND_OPTIONS_INIT \
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a diff for a commit in mbox format for sending via email.
|
||||
*
|
||||
* @param out buffer to store the e-mail patch in
|
||||
* @param diff the changes to include in the email
|
||||
* @param patch_idx the patch index
|
||||
* @param patch_count the total number of patches that will be included
|
||||
* @param commit_id the commit id for this change
|
||||
* @param summary the commit message for this change
|
||||
* @param body optional text to include above the diffstat
|
||||
* @param author the person who authored this commit
|
||||
* @param opts email creation options
|
||||
*/
|
||||
GIT_EXTERN(int) git_email_create_from_diff(
|
||||
git_buf *out,
|
||||
git_diff *diff,
|
||||
size_t patch_idx,
|
||||
size_t patch_count,
|
||||
const git_oid *commit_id,
|
||||
const char *summary,
|
||||
const char *body,
|
||||
const git_signature *author,
|
||||
const git_email_create_options *opts);
|
||||
|
||||
/**
|
||||
* Create a diff for a commit in mbox format for sending via email.
|
||||
* The commit must not be a merge commit.
|
||||
*
|
||||
* @param out buffer to store the e-mail patch in
|
||||
* @param commit commit to create a patch for
|
||||
* @param opts email creation options
|
||||
*/
|
||||
GIT_EXTERN(int) git_email_create_from_commit(
|
||||
git_buf *out,
|
||||
git_commit *commit,
|
||||
const git_email_create_options *opts);
|
||||
|
||||
GIT_END_DECL
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif
|
|
@ -66,11 +66,17 @@ typedef struct {
|
|||
/** See `git_filter_flag_t` above */
|
||||
uint32_t flags;
|
||||
|
||||
#ifdef GIT_DEPRECATE_HARD
|
||||
void *reserved;
|
||||
#else
|
||||
git_oid *commit_id;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The commit to load attributes from, when
|
||||
* `GIT_FILTER_ATTRIBUTES_FROM_COMMIT` is specified.
|
||||
*/
|
||||
git_oid *commit_id;
|
||||
git_oid attr_commit_id;
|
||||
} git_filter_options;
|
||||
|
||||
#define GIT_FILTER_OPTIONS_VERSION 1
|
||||
|
|
|
@ -84,8 +84,8 @@ GIT_EXTERN(void) git_note_iterator_free(git_note_iterator *it);
|
|||
* (negative value)
|
||||
*/
|
||||
GIT_EXTERN(int) git_note_next(
|
||||
git_oid* note_id,
|
||||
git_oid* annotated_id,
|
||||
git_oid *note_id,
|
||||
git_oid *annotated_id,
|
||||
git_note_iterator *it);
|
||||
|
||||
|
||||
|
|
|
@ -19,19 +19,16 @@ typedef struct git_oidarray {
|
|||
} git_oidarray;
|
||||
|
||||
/**
|
||||
* Free the OID array
|
||||
*
|
||||
* This method must (and must only) be called on `git_oidarray`
|
||||
* objects where the array is allocated by the library. Not doing so,
|
||||
* will result in a memory leak.
|
||||
* Free the object IDs contained in an oid_array. This method should
|
||||
* be called on `git_oidarray` objects that were provided by the
|
||||
* library. Not doing so will result in a memory leak.
|
||||
*
|
||||
* This does not free the `git_oidarray` itself, since the library will
|
||||
* never allocate that object directly itself (it is more commonly embedded
|
||||
* inside another struct or created on the stack).
|
||||
* never allocate that object directly itself.
|
||||
*
|
||||
* @param array git_oidarray from which to free oid data
|
||||
*/
|
||||
GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
|
||||
GIT_EXTERN(void) git_oidarray_dispose(git_oidarray *array);
|
||||
|
||||
/** @} */
|
||||
GIT_END_DECL
|
||||
|
|
|
@ -243,7 +243,7 @@ GIT_EXTERN(const char *) git_remote_pushurl(const git_remote *remote);
|
|||
* @param url the url to set
|
||||
* @return 0 or an error value
|
||||
*/
|
||||
GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char* url);
|
||||
GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char *url);
|
||||
|
||||
/**
|
||||
* Set the remote's url for pushing in the configuration.
|
||||
|
@ -257,7 +257,7 @@ GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, con
|
|||
* @param url the url to set
|
||||
* @return 0, or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url);
|
||||
GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char *url);
|
||||
|
||||
/**
|
||||
* Set the url for this particular url instance. The URL in the
|
||||
|
@ -451,7 +451,7 @@ typedef int GIT_CALLBACK(git_push_transfer_progress_cb)(
|
|||
unsigned int current,
|
||||
unsigned int total,
|
||||
size_t bytes,
|
||||
void* payload);
|
||||
void *payload);
|
||||
|
||||
/**
|
||||
* Represents an update which will be performed on the remote during push
|
||||
|
@ -971,7 +971,7 @@ GIT_EXTERN(int) git_remote_rename(
|
|||
* @param remote_name name to be checked.
|
||||
* @return 0 on success or an error code
|
||||
*/
|
||||
int git_remote_name_is_valid(int *valid, const char *remote_name);
|
||||
GIT_EXTERN(int) git_remote_name_is_valid(int *valid, const char *remote_name);
|
||||
|
||||
/**
|
||||
* Delete an existing persisted remote.
|
||||
|
|
|
@ -762,13 +762,15 @@ GIT_EXTERN(int) git_repository_mergehead_foreach(
|
|||
*
|
||||
* @param out Output value of calculated SHA
|
||||
* @param repo Repository pointer
|
||||
* @param path Path to file on disk whose contents should be hashed. If the
|
||||
* repository is not NULL, this can be a relative path.
|
||||
* @param path Path to file on disk whose contents should be hashed. This
|
||||
* may be an absolute path or a relative path, in which case it
|
||||
* will be treated as a path within the working directory.
|
||||
* @param type The object type to hash as (e.g. GIT_OBJECT_BLOB)
|
||||
* @param as_path The path to use to look up filtering rules. If this is
|
||||
* NULL, then the `path` parameter will be used instead. If
|
||||
* this is passed as the empty string, then no filters will be
|
||||
* applied when calculating the hash.
|
||||
* an empty string then no filters will be applied when
|
||||
* calculating the hash. If this is `NULL` and the `path`
|
||||
* parameter is a file within the repository's working
|
||||
* directory, then the `path` will be used.
|
||||
* @return 0 on success, or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_repository_hashfile(
|
||||
|
@ -797,8 +799,8 @@ GIT_EXTERN(int) git_repository_hashfile(
|
|||
* @return 0 on success, or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_repository_set_head(
|
||||
git_repository* repo,
|
||||
const char* refname);
|
||||
git_repository *repo,
|
||||
const char *refname);
|
||||
|
||||
/**
|
||||
* Make the repository HEAD directly point to the Commit.
|
||||
|
@ -817,8 +819,8 @@ GIT_EXTERN(int) git_repository_set_head(
|
|||
* @return 0 on success, or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_repository_set_head_detached(
|
||||
git_repository* repo,
|
||||
const git_oid* commitish);
|
||||
git_repository *repo,
|
||||
const git_oid *commitish);
|
||||
|
||||
/**
|
||||
* Make the repository HEAD directly point to the Commit.
|
||||
|
@ -854,7 +856,7 @@ GIT_EXTERN(int) git_repository_set_head_detached_from_annotated(
|
|||
* branch or an error code
|
||||
*/
|
||||
GIT_EXTERN(int) git_repository_detach_head(
|
||||
git_repository* repo);
|
||||
git_repository *repo);
|
||||
|
||||
/**
|
||||
* Repository state
|
||||
|
|
|
@ -200,7 +200,7 @@ GIT_EXTERN(int) git_stash_apply(
|
|||
*/
|
||||
typedef int GIT_CALLBACK(git_stash_cb)(
|
||||
size_t index,
|
||||
const char* message,
|
||||
const char *message,
|
||||
const git_oid *stash_id,
|
||||
void *payload);
|
||||
|
||||
|
|
|
@ -29,9 +29,7 @@
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
#ifdef _MSC_VER // [
|
||||
|
||||
#ifndef _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
@ -245,3 +243,5 @@ typedef uint64_t uintmax_t;
|
|||
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
|
||||
#endif // _MSC_VER ]
|
45
libgit2/headers/git2/sys/email.h
Normal file
45
libgit2/headers/git2/sys/email.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (C) the libgit2 contributors. All rights reserved.
|
||||
*
|
||||
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
||||
* a Linking Exception. For full terms see the included COPYING file.
|
||||
*/
|
||||
#ifndef INCLUDE_sys_git_email_h__
|
||||
#define INCLUDE_sys_git_email_h__
|
||||
|
||||
/**
|
||||
* @file git2/sys/email.h
|
||||
* @brief Advanced git email creation routines
|
||||
* @defgroup git_email Advanced git email creation routines
|
||||
* @ingroup Git
|
||||
* @{
|
||||
*/
|
||||
GIT_BEGIN_DECL
|
||||
|
||||
/**
|
||||
* Create a diff for a commit in mbox format for sending via email.
|
||||
*
|
||||
* @param out buffer to store the e-mail patch in
|
||||
* @param diff the changes to include in the email
|
||||
* @param patch_idx the patch index
|
||||
* @param patch_count the total number of patches that will be included
|
||||
* @param commit_id the commit id for this change
|
||||
* @param summary the commit message for this change
|
||||
* @param body optional text to include above the diffstat
|
||||
* @param author the person who authored this commit
|
||||
* @param opts email creation options
|
||||
*/
|
||||
GIT_EXTERN(int) git_email_create_from_diff(
|
||||
git_buf *out,
|
||||
git_diff *diff,
|
||||
size_t patch_idx,
|
||||
size_t patch_count,
|
||||
const git_oid *commit_id,
|
||||
const char *summary,
|
||||
const char *body,
|
||||
const git_signature *author,
|
||||
const git_email_create_options *opts);
|
||||
|
||||
/** @} */
|
||||
GIT_END_DECL
|
||||
#endif
|
|
@ -7,12 +7,12 @@
|
|||
#ifndef INCLUDE_git_version_h__
|
||||
#define INCLUDE_git_version_h__
|
||||
|
||||
#define LIBGIT2_VERSION "1.2.0"
|
||||
#define LIBGIT2_VERSION "1.3.0"
|
||||
#define LIBGIT2_VER_MAJOR 1
|
||||
#define LIBGIT2_VER_MINOR 2
|
||||
#define LIBGIT2_VER_MINOR 3
|
||||
#define LIBGIT2_VER_REVISION 0
|
||||
#define LIBGIT2_VER_PATCH 0
|
||||
|
||||
#define LIBGIT2_SOVERSION "1.2"
|
||||
#define LIBGIT2_SOVERSION "1.3"
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue