diff --git a/lib/src/bindings/libgit2_bindings.dart b/lib/src/bindings/libgit2_bindings.dart index 2a8bdbe..ea4497a 100644 --- a/lib/src/bindings/libgit2_bindings.dart +++ b/lib/src/bindings/libgit2_bindings.dart @@ -2015,6 +2015,11 @@ class Libgit2 { /// > /// > - `ciphers` is the list of ciphers that are eanbled. /// + /// * opts(GIT_OPT_GET_USER_AGENT, git_buf *out) + /// + /// > Get the value of the User-Agent header. + /// > The User-Agent is written to the `out` buffer. + /// /// * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled) /// /// > Enable or disable the use of "offset deltas" when creating packfiles, @@ -4917,6 +4922,7 @@ class Libgit2 { /// /// @param bld Tree builder /// @param filename Filename of the entry to remove + /// @return 0 or an error code int git_treebuilder_remove( ffi.Pointer bld, ffi.Pointer filename, @@ -5086,6 +5092,7 @@ class Libgit2 { /// @param baseline the tree to base these changes on /// @param nupdates the number of elements in the update list /// @param updates the list of updates to perform + /// @return 0 or an error code int git_tree_create_updated( ffi.Pointer out, ffi.Pointer repo, @@ -5386,7 +5393,7 @@ class Libgit2 { /// /// The message for the reflog will be ignored if the reference does /// not belong in the standard set (HEAD, branches and remote-tracking - /// branches) and and it does not have a reflog. + /// branches) and it does not have a reflog. /// /// @param out Pointer to the newly created reference /// @param repo Repository where that reference will live @@ -5443,7 +5450,7 @@ class Libgit2 { /// /// The message for the reflog will be ignored if the reference does /// not belong in the standard set (HEAD, branches and remote-tracking - /// branches) and and it does not have a reflog. + /// branches) and it does not have a reflog. /// /// It will return GIT_EMODIFIED if the reference's value at the time /// of updating does not match the one passed through `current_id` @@ -5650,7 +5657,7 @@ class Libgit2 { /// /// The message for the reflog will be ignored if the reference does /// not belong in the standard set (HEAD, branches and remote-tracking - /// branches) and and it does not have a reflog. + /// branches) and it does not have a reflog. /// /// @param out Pointer to the newly created reference /// @param ref The reference @@ -6700,7 +6707,7 @@ class Libgit2 { /// Query how many diff deltas are there in a diff filtered by type. /// - /// This works just like `git_diff_entrycount()` with an extra parameter + /// This works just like `git_diff_num_deltas()` with an extra parameter /// that is a `git_delta_t` and returns just the count of how many deltas /// match that particular type. /// @@ -7394,6 +7401,7 @@ class Libgit2 { /// @param preimage the tree to apply the diff to /// @param diff the diff to apply /// @param options the options for the apply (or null for defaults) + /// @return 0 or an error code int git_apply_to_tree( ffi.Pointer> out, ffi.Pointer repo, @@ -7422,6 +7430,7 @@ class Libgit2 { /// @param diff the diff to apply /// @param location the location to apply (workdir, index or both) /// @param options the options for the apply (or null for defaults) + /// @return 0 or an error code int git_apply( ffi.Pointer repo, ffi.Pointer diff, @@ -7778,6 +7787,31 @@ class Libgit2 { late final _dart_git_blob_rawsize _git_blob_rawsize = _git_blob_rawsize_ptr.asFunction<_dart_git_blob_rawsize>(); + /// Initialize git_blob_filter_options structure + /// + /// Initializes a `git_blob_filter_options` with default values. Equivalent + /// to creating an instance with `GIT_BLOB_FILTER_OPTIONS_INIT`. + /// + /// @param opts The `git_blob_filter_options` struct to initialize. + /// @param version The struct version; pass `GIT_BLOB_FILTER_OPTIONS_VERSION`. + /// @return Zero on success; -1 on failure. + int git_blob_filter_options_init( + ffi.Pointer opts, + int version, + ) { + return _git_blob_filter_options_init( + opts, + version, + ); + } + + late final _git_blob_filter_options_init_ptr = + _lookup>( + 'git_blob_filter_options_init'); + late final _dart_git_blob_filter_options_init _git_blob_filter_options_init = + _git_blob_filter_options_init_ptr + .asFunction<_dart_git_blob_filter_options_init>(); + /// Get a buffer with the filtered content of a blob. /// /// This applies filters as if the blob was being checked out to the @@ -7942,7 +7976,7 @@ class Libgit2 { /// Write an in-memory buffer to the ODB as a blob /// /// @param id return the id of the written blob - /// @param repo repository where to blob will be written + /// @param repo repository where the blob will be written /// @param buffer data to be written into the blob /// @param len length of the data /// @return 0 or an error code @@ -9215,7 +9249,7 @@ class Libgit2 { /// /// The index must not contain any file in conflict. /// - /// @param out Pointer where to store OID of the the written tree + /// @param out Pointer where to store OID of the written tree /// @param index Index to write /// @param repo Repository where to write the tree /// @return 0 on success, GIT_EUNMERGED when the index is not clean @@ -9760,7 +9794,7 @@ class Libgit2 { /// @param at_pos the address to which the position of the index entry is written (optional) /// @param index an existing index object /// @param path path to search - /// @return a zero-based position in the index if found; GIT_ENOTFOUND otherwise + /// @return 0 with valid value in at_pos; an error code otherwise int git_index_find( ffi.Pointer at_pos, ffi.Pointer index, @@ -13689,7 +13723,7 @@ class Libgit2 { /// /// Git allows you to store your global configuration at /// `$HOME/.gitconfig` or `$XDG_CONFIG_HOME/git/config`. For backwards - /// compatability, the XDG file shouldn't be used unless the use has + /// compatibility, the XDG file shouldn't be used unless the use has /// created it explicitly. With this function you'll open the correct /// one to write to. /// @@ -19194,7 +19228,7 @@ class Libgit2 { /// /// @param odb database to add the backend to /// @param path path to the objects folder for the alternate - /// @return 0 on success; error code otherwise + /// @return 0 on success, error code otherwise int git_odb_add_disk_alternate( ffi.Pointer odb, ffi.Pointer path, @@ -19240,9 +19274,8 @@ class Libgit2 { /// @param out pointer where to store the read object /// @param db database to search for the object in. /// @param id identity of the object to read. - /// @return - /// - 0 if the object was read; - /// - GIT_ENOTFOUND if the object is not in the database. + /// @return 0 if the object was read, GIT_ENOTFOUND if the object is + /// not in the database. int git_odb_read( ffi.Pointer> out, ffi.Pointer db, @@ -19281,10 +19314,9 @@ class Libgit2 { /// @param db database to search for the object in. /// @param short_id a prefix of the id of the object to read. /// @param len the length of the prefix - /// @return - /// - 0 if the object was read; - /// - GIT_ENOTFOUND if the object is not in the database. - /// - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix) + /// @return 0 if the object was read, GIT_ENOTFOUND if the object is not in the + /// database. GIT_EAMBIGUOUS if the prefix is ambiguous + /// (several objects match the prefix) int git_odb_read_prefix( ffi.Pointer> out, ffi.Pointer db, @@ -19318,9 +19350,8 @@ class Libgit2 { /// @param type_out pointer where to store the type /// @param db database to search for the object in. /// @param id identity of the object to read. - /// @return - /// - 0 if the object was read; - /// - GIT_ENOTFOUND if the object is not in the database. + /// @return 0 if the object was read, GIT_ENOTFOUND if the object is not + /// in the database. int git_odb_read_header( ffi.Pointer len_out, ffi.Pointer type_out, @@ -19345,9 +19376,7 @@ class Libgit2 { /// /// @param db database to be searched for the given object. /// @param id the object to search for. - /// @return - /// - 1, if the object was found - /// - 0, otherwise + /// @return 1 if the object was found, 0 otherwise int git_odb_exists( ffi.Pointer db, ffi.Pointer id, @@ -19566,7 +19595,7 @@ class Libgit2 { /// @param stream the stream /// @param buffer the data to write /// @param len the buffer's length - /// @return 0 if the write succeeded; error code otherwise + /// @return 0 if the write succeeded, error code otherwise int git_odb_stream_write( ffi.Pointer stream, ffi.Pointer buffer, @@ -19595,7 +19624,7 @@ class Libgit2 { /// /// @param out pointer to store the resulting object's id /// @param stream the stream - /// @return 0 on success; an error code otherwise + /// @return 0 on success, an error code otherwise int git_odb_stream_finalize_write( ffi.Pointer out, ffi.Pointer stream, @@ -19674,7 +19703,7 @@ class Libgit2 { /// @param type pointer where to store the type of the object /// @param db object database where the stream will read from /// @param oid oid of the object the stream will read from - /// @return 0 if the stream was created; error code otherwise + /// @return 0 if the stream was created, error code otherwise int git_odb_open_rstream( ffi.Pointer> out, ffi.Pointer len, @@ -19925,7 +19954,7 @@ class Libgit2 { /// @param odb database to add the backend to /// @param backend pointer to a git_odb_backend instance /// @param priority Value for ordering the backends queue - /// @return 0 on success; error code otherwise + /// @return 0 on success, error code otherwise int git_odb_add_backend( ffi.Pointer odb, ffi.Pointer backend, @@ -19960,7 +19989,7 @@ class Libgit2 { /// @param odb database to add the backend to /// @param backend pointer to a git_odb_backend instance /// @param priority Value for ordering the backends queue - /// @return 0 on success; error code otherwise + /// @return 0 on success, error code otherwise int git_odb_add_alternate( ffi.Pointer odb, ffi.Pointer backend, @@ -20002,7 +20031,7 @@ class Libgit2 { /// @param out output pointer to ODB backend at pos /// @param odb object database /// @param pos index into object database backend list - /// @return 0 on success; GIT_ENOTFOUND if pos is invalid; other errors < 0 + /// @return 0 on success, GIT_ENOTFOUND if pos is invalid, other errors < 0 int git_odb_get_backend( ffi.Pointer> out, ffi.Pointer odb, @@ -23705,35 +23734,39 @@ abstract class git_repository_open_flag_t { /// /// These flags configure extra behaviors to `git_repository_init_ext`. /// In every case, the default behavior is the zero value (i.e. flag is -/// not set). Just OR the flag values together for the `flags` parameter -/// when initializing a new repo. Details of individual values are: -/// -/// * BARE - Create a bare repository with no working directory. -/// * NO_REINIT - Return an GIT_EEXISTS error if the repo_path appears to -/// already be an git repository. -/// * NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo -/// path for non-bare repos (if it is not already there), but -/// passing this flag prevents that behavior. -/// * MKDIR - Make the repo_path (and workdir_path) as needed. Init is -/// always willing to create the ".git" directory even without this -/// flag. This flag tells init to create the trailing component of -/// the repo and workdir paths as needed. -/// * MKPATH - Recursively make all components of the repo and workdir -/// paths as necessary. -/// * EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to -/// initialize a new repo. This flags enables external templates, -/// looking the "template_path" from the options if set, or the -/// `init.templatedir` global config if not, or falling back on -/// "/usr/share/git-core/templates" if it exists. -/// * GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is -/// specified, use relative paths for the gitdir and core.worktree. +/// not set). Just OR the flag values together for the `flags` parameter +/// when initializing a new repo. abstract class git_repository_init_flag_t { + /// Create a bare repository with no working directory. static const int GIT_REPOSITORY_INIT_BARE = 1; + + /// Return an GIT_EEXISTS error if the repo_path appears to already be + /// an git repository. static const int GIT_REPOSITORY_INIT_NO_REINIT = 2; + + /// Normally a "/.git/" will be appended to the repo path for + /// non-bare repos (if it is not already there), but passing this flag + /// prevents that behavior. static const int GIT_REPOSITORY_INIT_NO_DOTGIT_DIR = 4; + + /// Make the repo_path (and workdir_path) as needed. Init is always willing + /// to create the ".git" directory even without this flag. This flag tells + /// init to create the trailing component of the repo and workdir paths + /// as needed. static const int GIT_REPOSITORY_INIT_MKDIR = 8; + + /// Recursively make all components of the repo and workdir paths as + /// necessary. static const int GIT_REPOSITORY_INIT_MKPATH = 16; + + /// libgit2 normally uses internal templates to initialize a new repo. + /// This flags enables external templates, looking the "template_path" from + /// the options if set, or the `init.templatedir` global config if not, + /// or falling back on "/usr/share/git-core/templates" if it exists. static const int GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE = 32; + + /// If an alternate workdir is specified, use relative paths for the gitdir + /// and core.worktree. static const int GIT_REPOSITORY_INIT_RELATIVE_GITLINK = 64; } @@ -23741,63 +23774,61 @@ abstract class git_repository_init_flag_t { /// /// Set the mode field of the `git_repository_init_options` structure /// either to the custom mode that you would like, or to one of the -/// following modes: -/// -/// * SHARED_UMASK - Use permissions configured by umask - the default. -/// * SHARED_GROUP - Use "--shared=group" behavior, chmod'ing the new repo -/// to be group writable and "g+sx" for sticky group assignment. -/// * SHARED_ALL - Use "--shared=all" behavior, adding world readability. -/// * Anything else - Set to custom value. +/// defined modes. abstract class git_repository_init_mode_t { + /// Use permissions configured by umask - the default. static const int GIT_REPOSITORY_INIT_SHARED_UMASK = 0; + + /// Use "--shared=group" behavior, chmod'ing the new repo to be group + /// writable and "g+sx" for sticky group assignment. static const int GIT_REPOSITORY_INIT_SHARED_GROUP = 1533; + + /// Use "--shared=all" behavior, adding world readability. static const int GIT_REPOSITORY_INIT_SHARED_ALL = 1535; } /// Extended options structure for `git_repository_init_ext`. /// /// This contains extra options for `git_repository_init_ext` that enable -/// additional initialization features. The fields are: -/// -/// * flags - Combination of GIT_REPOSITORY_INIT flags above. -/// * mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... -/// constants above, or to a custom value that you would like. -/// * workdir_path - The path to the working dir or NULL for default (i.e. -/// repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH, -/// IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not -/// the "natural" working directory, a .git gitlink file will be -/// created here linking to the repo_path. -/// * description - If set, this will be used to initialize the "description" -/// file in the repository, instead of using the template content. -/// * template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, -/// this contains the path to use for the template directory. If -/// this is NULL, the config or default directory options will be -/// used instead. -/// * initial_head - The name of the head to point HEAD at. If NULL, then -/// this will be treated as "master" and the HEAD ref will be set -/// to "refs/heads/master". If this begins with "refs/" it will be -/// used verbatim; otherwise "refs/heads/" will be prefixed. -/// * origin_url - If this is non-NULL, then after the rest of the -/// repository initialization is completed, an "origin" remote -/// will be added pointing to this URL. +/// additional initialization features. class git_repository_init_options extends ffi.Struct { @ffi.Uint32() external int version; + /// Combination of GIT_REPOSITORY_INIT flags above. @ffi.Uint32() external int flags; + /// Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... constants + /// above, or to a custom value that you would like. @ffi.Uint32() external int mode; + /// The path to the working dir or NULL for default (i.e. repo_path parent + /// on non-bare repos). IF THIS IS RELATIVE PATH, IT WILL BE EVALUATED + /// RELATIVE TO THE REPO_PATH. If this is not the "natural" working + /// directory, a .git gitlink file will be created here linking to the + /// repo_path. external ffi.Pointer workdir_path; + /// If set, this will be used to initialize the "description" file in the + /// repository, instead of using the template content. external ffi.Pointer description; + /// When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains + /// the path to use for the template directory. If this is NULL, the config + /// or default directory options will be used instead. external ffi.Pointer template_path; + /// The name of the head to point HEAD at. If NULL, then this will be + /// treated as "master" and the HEAD ref will be set to "refs/heads/master". + /// If this begins with "refs/" it will be used verbatim; + /// otherwise "refs/heads/" will be prefixed. external ffi.Pointer initial_head; + /// If this is non-NULL, then after the rest of the repository + /// initialization is completed, an "origin" remote will be added + /// pointing to this URL. external ffi.Pointer origin_url; } @@ -24727,6 +24758,9 @@ abstract class git_blob_filter_flag_t { } /// The options used when applying filter options to a file. +/// +/// Initialize with `GIT_BLOB_FILTER_OPTIONS_INIT`. Alternatively, you can +/// use `git_blob_filter_options_init`. class git_blob_filter_options extends ffi.Struct { @ffi.Int32() external int version; @@ -28023,13 +28057,13 @@ const int GIT_CREDTYPE_USERNAME = 32; const int GIT_CREDTYPE_SSH_MEMORY = 64; -const String LIBGIT2_VERSION = '1.1.0'; +const String LIBGIT2_VERSION = '1.1.1'; const int LIBGIT2_VER_MAJOR = 1; const int LIBGIT2_VER_MINOR = 1; -const int LIBGIT2_VER_REVISION = 0; +const int LIBGIT2_VER_REVISION = 1; const int LIBGIT2_VER_PATCH = 0; @@ -31706,6 +31740,16 @@ typedef _dart_git_blob_rawsize = int Function( ffi.Pointer blob, ); +typedef _c_git_blob_filter_options_init = ffi.Int32 Function( + ffi.Pointer opts, + ffi.Uint32 version, +); + +typedef _dart_git_blob_filter_options_init = int Function( + ffi.Pointer opts, + int version, +); + typedef _c_git_blob_filter = ffi.Int32 Function( ffi.Pointer out, ffi.Pointer blob, diff --git a/lib/src/util.dart b/lib/src/util.dart index a8a2897..8183020 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -5,15 +5,15 @@ import 'bindings/libgit2_bindings.dart'; DynamicLibrary loadLibrary() { if (Platform.isLinux || Platform.isAndroid || Platform.isFuchsia) { return DynamicLibrary.open( - '${Directory.current.path}/libgit2-1.1.0/libgit2.so'); + '${Directory.current.path}/libgit2/libgit2-1.1.1.so'); } if (Platform.isMacOS) { return DynamicLibrary.open( - '${Directory.current.path}/libgit2-1.1.0/libgit2.dylib'); + '${Directory.current.path}/libgit2/libgit2-1.1.1.dylib'); } if (Platform.isWindows) { return DynamicLibrary.open( - '${Directory.current.path}/libgit2-1.1.0/libgit2.dll'); + '${Directory.current.path}/libgit2/libgit2-1.1.1.dll'); } throw Exception('Platform not implemented'); } diff --git a/libgit2-1.1.0/libgit2.so b/libgit2-1.1.0/libgit2.so deleted file mode 100755 index d54f8ee..0000000 Binary files a/libgit2-1.1.0/libgit2.so and /dev/null differ diff --git a/libgit2-1.1.0/headers/git2.h b/libgit2/headers/git2.h similarity index 100% rename from libgit2-1.1.0/headers/git2.h rename to libgit2/headers/git2.h diff --git a/libgit2-1.1.0/headers/git2/annotated_commit.h b/libgit2/headers/git2/annotated_commit.h similarity index 100% rename from libgit2-1.1.0/headers/git2/annotated_commit.h rename to libgit2/headers/git2/annotated_commit.h diff --git a/libgit2-1.1.0/headers/git2/apply.h b/libgit2/headers/git2/apply.h similarity index 98% rename from libgit2-1.1.0/headers/git2/apply.h rename to libgit2/headers/git2/apply.h index b248eaa..bc637df 100644 --- a/libgit2-1.1.0/headers/git2/apply.h +++ b/libgit2/headers/git2/apply.h @@ -100,6 +100,7 @@ GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int ver * @param preimage the tree to apply the diff to * @param diff the diff to apply * @param options the options for the apply (or null for defaults) + * @return 0 or an error code */ GIT_EXTERN(int) git_apply_to_tree( git_index **out, @@ -137,6 +138,7 @@ typedef enum { * @param diff the diff to apply * @param location the location to apply (workdir, index or both) * @param options the options for the apply (or null for defaults) + * @return 0 or an error code */ GIT_EXTERN(int) git_apply( git_repository *repo, diff --git a/libgit2-1.1.0/headers/git2/attr.h b/libgit2/headers/git2/attr.h similarity index 100% rename from libgit2-1.1.0/headers/git2/attr.h rename to libgit2/headers/git2/attr.h diff --git a/libgit2-1.1.0/headers/git2/blame.h b/libgit2/headers/git2/blame.h similarity index 100% rename from libgit2-1.1.0/headers/git2/blame.h rename to libgit2/headers/git2/blame.h diff --git a/libgit2-1.1.0/headers/git2/blob.h b/libgit2/headers/git2/blob.h similarity index 92% rename from libgit2-1.1.0/headers/git2/blob.h rename to libgit2/headers/git2/blob.h index 7e2a745..1f7442e 100644 --- a/libgit2-1.1.0/headers/git2/blob.h +++ b/libgit2/headers/git2/blob.h @@ -118,6 +118,10 @@ typedef enum { /** * The options used when applying filter options to a file. + * + * Initialize with `GIT_BLOB_FILTER_OPTIONS_INIT`. Alternatively, you can + * use `git_blob_filter_options_init`. + * */ typedef struct { int version; @@ -129,6 +133,18 @@ typedef struct { #define GIT_BLOB_FILTER_OPTIONS_VERSION 1 #define GIT_BLOB_FILTER_OPTIONS_INIT {GIT_BLOB_FILTER_OPTIONS_VERSION, GIT_BLOB_FILTER_CHECK_FOR_BINARY} +/** + * Initialize git_blob_filter_options structure + * + * Initializes a `git_blob_filter_options` with default values. Equivalent + * to creating an instance with `GIT_BLOB_FILTER_OPTIONS_INIT`. + * + * @param opts The `git_blob_filter_options` struct to initialize. + * @param version The struct version; pass `GIT_BLOB_FILTER_OPTIONS_VERSION`. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_blob_filter_options_init(git_blob_filter_options *opts, unsigned int version); + /** * Get a buffer with the filtered content of a blob. * @@ -229,7 +245,7 @@ GIT_EXTERN(int) git_blob_create_from_stream_commit( * Write an in-memory buffer to the ODB as a blob * * @param id return the id of the written blob - * @param repo repository where to blob will be written + * @param repo repository where the blob will be written * @param buffer data to be written into the blob * @param len length of the data * @return 0 or an error code diff --git a/libgit2-1.1.0/headers/git2/branch.h b/libgit2/headers/git2/branch.h similarity index 100% rename from libgit2-1.1.0/headers/git2/branch.h rename to libgit2/headers/git2/branch.h diff --git a/libgit2-1.1.0/headers/git2/buffer.h b/libgit2/headers/git2/buffer.h similarity index 100% rename from libgit2-1.1.0/headers/git2/buffer.h rename to libgit2/headers/git2/buffer.h diff --git a/libgit2-1.1.0/headers/git2/cert.h b/libgit2/headers/git2/cert.h similarity index 100% rename from libgit2-1.1.0/headers/git2/cert.h rename to libgit2/headers/git2/cert.h diff --git a/libgit2-1.1.0/headers/git2/checkout.h b/libgit2/headers/git2/checkout.h similarity index 100% rename from libgit2-1.1.0/headers/git2/checkout.h rename to libgit2/headers/git2/checkout.h diff --git a/libgit2-1.1.0/headers/git2/cherrypick.h b/libgit2/headers/git2/cherrypick.h similarity index 100% rename from libgit2-1.1.0/headers/git2/cherrypick.h rename to libgit2/headers/git2/cherrypick.h diff --git a/libgit2-1.1.0/headers/git2/clone.h b/libgit2/headers/git2/clone.h similarity index 100% rename from libgit2-1.1.0/headers/git2/clone.h rename to libgit2/headers/git2/clone.h diff --git a/libgit2-1.1.0/headers/git2/commit.h b/libgit2/headers/git2/commit.h similarity index 100% rename from libgit2-1.1.0/headers/git2/commit.h rename to libgit2/headers/git2/commit.h diff --git a/libgit2-1.1.0/headers/git2/common.h b/libgit2/headers/git2/common.h similarity index 98% rename from libgit2-1.1.0/headers/git2/common.h rename to libgit2/headers/git2/common.h index 8dd30d5..dee260e 100644 --- a/libgit2-1.1.0/headers/git2/common.h +++ b/libgit2/headers/git2/common.h @@ -356,6 +356,11 @@ typedef enum { * > * > - `ciphers` is the list of ciphers that are eanbled. * + * * opts(GIT_OPT_GET_USER_AGENT, git_buf *out) + * + * > Get the value of the User-Agent header. + * > The User-Agent is written to the `out` buffer. + * * * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled) * * > Enable or disable the use of "offset deltas" when creating packfiles, diff --git a/libgit2-1.1.0/headers/git2/config.h b/libgit2/headers/git2/config.h similarity index 99% rename from libgit2-1.1.0/headers/git2/config.h rename to libgit2/headers/git2/config.h index abf5bbb..7c8e388 100644 --- a/libgit2-1.1.0/headers/git2/config.h +++ b/libgit2/headers/git2/config.h @@ -263,7 +263,7 @@ GIT_EXTERN(int) git_config_open_level( * * Git allows you to store your global configuration at * `$HOME/.gitconfig` or `$XDG_CONFIG_HOME/git/config`. For backwards - * compatability, the XDG file shouldn't be used unless the use has + * compatibility, the XDG file shouldn't be used unless the use has * created it explicitly. With this function you'll open the correct * one to write to. * diff --git a/libgit2-1.1.0/headers/git2/cred_helpers.h b/libgit2/headers/git2/cred_helpers.h similarity index 100% rename from libgit2-1.1.0/headers/git2/cred_helpers.h rename to libgit2/headers/git2/cred_helpers.h diff --git a/libgit2-1.1.0/headers/git2/credential.h b/libgit2/headers/git2/credential.h similarity index 100% rename from libgit2-1.1.0/headers/git2/credential.h rename to libgit2/headers/git2/credential.h diff --git a/libgit2-1.1.0/headers/git2/credential_helpers.h b/libgit2/headers/git2/credential_helpers.h similarity index 100% rename from libgit2-1.1.0/headers/git2/credential_helpers.h rename to libgit2/headers/git2/credential_helpers.h diff --git a/libgit2-1.1.0/headers/git2/deprecated.h b/libgit2/headers/git2/deprecated.h similarity index 100% rename from libgit2-1.1.0/headers/git2/deprecated.h rename to libgit2/headers/git2/deprecated.h diff --git a/libgit2-1.1.0/headers/git2/describe.h b/libgit2/headers/git2/describe.h similarity index 100% rename from libgit2-1.1.0/headers/git2/describe.h rename to libgit2/headers/git2/describe.h diff --git a/libgit2-1.1.0/headers/git2/diff.h b/libgit2/headers/git2/diff.h similarity index 99% rename from libgit2-1.1.0/headers/git2/diff.h rename to libgit2/headers/git2/diff.h index 3976ab1..e105555 100644 --- a/libgit2-1.1.0/headers/git2/diff.h +++ b/libgit2/headers/git2/diff.h @@ -998,7 +998,7 @@ GIT_EXTERN(size_t) git_diff_num_deltas(const git_diff *diff); /** * Query how many diff deltas are there in a diff filtered by type. * - * This works just like `git_diff_entrycount()` with an extra parameter + * This works just like `git_diff_num_deltas()` with an extra parameter * that is a `git_delta_t` and returns just the count of how many deltas * match that particular type. * diff --git a/libgit2-1.1.0/headers/git2/errors.h b/libgit2/headers/git2/errors.h similarity index 100% rename from libgit2-1.1.0/headers/git2/errors.h rename to libgit2/headers/git2/errors.h diff --git a/libgit2-1.1.0/headers/git2/filter.h b/libgit2/headers/git2/filter.h similarity index 100% rename from libgit2-1.1.0/headers/git2/filter.h rename to libgit2/headers/git2/filter.h diff --git a/libgit2-1.1.0/headers/git2/global.h b/libgit2/headers/git2/global.h similarity index 100% rename from libgit2-1.1.0/headers/git2/global.h rename to libgit2/headers/git2/global.h diff --git a/libgit2-1.1.0/headers/git2/graph.h b/libgit2/headers/git2/graph.h similarity index 100% rename from libgit2-1.1.0/headers/git2/graph.h rename to libgit2/headers/git2/graph.h diff --git a/libgit2-1.1.0/headers/git2/ignore.h b/libgit2/headers/git2/ignore.h similarity index 100% rename from libgit2-1.1.0/headers/git2/ignore.h rename to libgit2/headers/git2/ignore.h diff --git a/libgit2-1.1.0/headers/git2/index.h b/libgit2/headers/git2/index.h similarity index 99% rename from libgit2-1.1.0/headers/git2/index.h rename to libgit2/headers/git2/index.h index 3141351..dd92277 100644 --- a/libgit2-1.1.0/headers/git2/index.h +++ b/libgit2/headers/git2/index.h @@ -349,7 +349,7 @@ GIT_EXTERN(int) git_index_write_tree(git_oid *out, git_index *index); * * The index must not contain any file in conflict. * - * @param out Pointer where to store OID of the the written tree + * @param out Pointer where to store OID of the written tree * @param index Index to write * @param repo Repository where to write the tree * @return 0 on success, GIT_EUNMERGED when the index is not clean @@ -702,7 +702,7 @@ GIT_EXTERN(int) git_index_update_all( * @param at_pos the address to which the position of the index entry is written (optional) * @param index an existing index object * @param path path to search - * @return a zero-based position in the index if found; GIT_ENOTFOUND otherwise + * @return 0 with valid value in at_pos; an error code otherwise */ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path); diff --git a/libgit2-1.1.0/headers/git2/indexer.h b/libgit2/headers/git2/indexer.h similarity index 99% rename from libgit2-1.1.0/headers/git2/indexer.h rename to libgit2/headers/git2/indexer.h index 8059e4d..a434d24 100644 --- a/libgit2-1.1.0/headers/git2/indexer.h +++ b/libgit2/headers/git2/indexer.h @@ -51,7 +51,7 @@ typedef struct git_indexer_progress { * Type for progress callbacks during indexing. Return a value less * than zero to cancel the indexing or download. * - * @param stats Structure containing information about the state of the tran sfer + * @param stats Structure containing information about the state of the transfer * @param payload Payload provided by caller */ typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload); @@ -64,6 +64,7 @@ typedef struct git_indexer_options { /** progress_cb function to call with progress information */ git_indexer_progress_cb progress_cb; + /** progress_cb_payload payload for the progress callback */ void *progress_cb_payload; diff --git a/libgit2-1.1.0/headers/git2/mailmap.h b/libgit2/headers/git2/mailmap.h similarity index 100% rename from libgit2-1.1.0/headers/git2/mailmap.h rename to libgit2/headers/git2/mailmap.h diff --git a/libgit2-1.1.0/headers/git2/merge.h b/libgit2/headers/git2/merge.h similarity index 100% rename from libgit2-1.1.0/headers/git2/merge.h rename to libgit2/headers/git2/merge.h diff --git a/libgit2-1.1.0/headers/git2/message.h b/libgit2/headers/git2/message.h similarity index 100% rename from libgit2-1.1.0/headers/git2/message.h rename to libgit2/headers/git2/message.h diff --git a/libgit2-1.1.0/headers/git2/net.h b/libgit2/headers/git2/net.h similarity index 100% rename from libgit2-1.1.0/headers/git2/net.h rename to libgit2/headers/git2/net.h diff --git a/libgit2-1.1.0/headers/git2/notes.h b/libgit2/headers/git2/notes.h similarity index 100% rename from libgit2-1.1.0/headers/git2/notes.h rename to libgit2/headers/git2/notes.h diff --git a/libgit2-1.1.0/headers/git2/object.h b/libgit2/headers/git2/object.h similarity index 100% rename from libgit2-1.1.0/headers/git2/object.h rename to libgit2/headers/git2/object.h diff --git a/libgit2-1.1.0/headers/git2/odb.h b/libgit2/headers/git2/odb.h similarity index 95% rename from libgit2-1.1.0/headers/git2/odb.h rename to libgit2/headers/git2/odb.h index c4bfa52..62100d5 100644 --- a/libgit2-1.1.0/headers/git2/odb.h +++ b/libgit2/headers/git2/odb.h @@ -70,7 +70,7 @@ GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir); * * @param odb database to add the backend to * @param path path to the objects folder for the alternate - * @return 0 on success; error code otherwise + * @return 0 on success, error code otherwise */ GIT_EXTERN(int) git_odb_add_disk_alternate(git_odb *odb, const char *path); @@ -94,9 +94,8 @@ GIT_EXTERN(void) git_odb_free(git_odb *db); * @param out pointer where to store the read object * @param db database to search for the object in. * @param id identity of the object to read. - * @return - * - 0 if the object was read; - * - GIT_ENOTFOUND if the object is not in the database. + * @return 0 if the object was read, GIT_ENOTFOUND if the object is + * not in the database. */ GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id); @@ -122,10 +121,9 @@ GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *i * @param db database to search for the object in. * @param short_id a prefix of the id of the object to read. * @param len the length of the prefix - * @return - * - 0 if the object was read; - * - GIT_ENOTFOUND if the object is not in the database. - * - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix) + * @return 0 if the object was read, GIT_ENOTFOUND if the object is not in the + * database. GIT_EAMBIGUOUS if the prefix is ambiguous + * (several objects match the prefix) */ GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len); @@ -143,9 +141,8 @@ GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git * @param type_out pointer where to store the type * @param db database to search for the object in. * @param id identity of the object to read. - * @return - * - 0 if the object was read; - * - GIT_ENOTFOUND if the object is not in the database. + * @return 0 if the object was read, GIT_ENOTFOUND if the object is not + * in the database. */ GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id); @@ -154,9 +151,7 @@ GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_object_t *type_out, git * * @param db database to be searched for the given object. * @param id the object to search for. - * @return - * - 1, if the object was found - * - 0, otherwise + * @return 1 if the object was found, 0 otherwise */ GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id); @@ -305,7 +300,7 @@ GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_obje * @param stream the stream * @param buffer the data to write * @param len the buffer's length - * @return 0 if the write succeeded; error code otherwise + * @return 0 if the write succeeded, error code otherwise */ GIT_EXTERN(int) git_odb_stream_write(git_odb_stream *stream, const char *buffer, size_t len); @@ -320,7 +315,7 @@ GIT_EXTERN(int) git_odb_stream_write(git_odb_stream *stream, const char *buffer, * * @param out pointer to store the resulting object's id * @param stream the stream - * @return 0 on success; an error code otherwise + * @return 0 on success, an error code otherwise */ GIT_EXTERN(int) git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream); @@ -362,7 +357,7 @@ GIT_EXTERN(void) git_odb_stream_free(git_odb_stream *stream); * @param type pointer where to store the type of the object * @param db object database where the stream will read from * @param oid oid of the object the stream will read from - * @return 0 if the stream was created; error code otherwise + * @return 0 if the stream was created, error code otherwise */ GIT_EXTERN(int) git_odb_open_rstream( git_odb_stream **out, @@ -501,7 +496,7 @@ GIT_EXTERN(git_object_t) git_odb_object_type(git_odb_object *object); * @param odb database to add the backend to * @param backend pointer to a git_odb_backend instance * @param priority Value for ordering the backends queue - * @return 0 on success; error code otherwise + * @return 0 on success, error code otherwise */ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int priority); @@ -522,7 +517,7 @@ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int * @param odb database to add the backend to * @param backend pointer to a git_odb_backend instance * @param priority Value for ordering the backends queue - * @return 0 on success; error code otherwise + * @return 0 on success, error code otherwise */ GIT_EXTERN(int) git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, int priority); @@ -540,7 +535,7 @@ GIT_EXTERN(size_t) git_odb_num_backends(git_odb *odb); * @param out output pointer to ODB backend at pos * @param odb object database * @param pos index into object database backend list - * @return 0 on success; GIT_ENOTFOUND if pos is invalid; other errors < 0 + * @return 0 on success, GIT_ENOTFOUND if pos is invalid, other errors < 0 */ GIT_EXTERN(int) git_odb_get_backend(git_odb_backend **out, git_odb *odb, size_t pos); diff --git a/libgit2-1.1.0/headers/git2/odb_backend.h b/libgit2/headers/git2/odb_backend.h similarity index 100% rename from libgit2-1.1.0/headers/git2/odb_backend.h rename to libgit2/headers/git2/odb_backend.h diff --git a/libgit2-1.1.0/headers/git2/oid.h b/libgit2/headers/git2/oid.h similarity index 100% rename from libgit2-1.1.0/headers/git2/oid.h rename to libgit2/headers/git2/oid.h diff --git a/libgit2-1.1.0/headers/git2/oidarray.h b/libgit2/headers/git2/oidarray.h similarity index 100% rename from libgit2-1.1.0/headers/git2/oidarray.h rename to libgit2/headers/git2/oidarray.h diff --git a/libgit2-1.1.0/headers/git2/pack.h b/libgit2/headers/git2/pack.h similarity index 100% rename from libgit2-1.1.0/headers/git2/pack.h rename to libgit2/headers/git2/pack.h diff --git a/libgit2-1.1.0/headers/git2/patch.h b/libgit2/headers/git2/patch.h similarity index 100% rename from libgit2-1.1.0/headers/git2/patch.h rename to libgit2/headers/git2/patch.h diff --git a/libgit2-1.1.0/headers/git2/pathspec.h b/libgit2/headers/git2/pathspec.h similarity index 100% rename from libgit2-1.1.0/headers/git2/pathspec.h rename to libgit2/headers/git2/pathspec.h diff --git a/libgit2-1.1.0/headers/git2/proxy.h b/libgit2/headers/git2/proxy.h similarity index 100% rename from libgit2-1.1.0/headers/git2/proxy.h rename to libgit2/headers/git2/proxy.h diff --git a/libgit2-1.1.0/headers/git2/rebase.h b/libgit2/headers/git2/rebase.h similarity index 100% rename from libgit2-1.1.0/headers/git2/rebase.h rename to libgit2/headers/git2/rebase.h diff --git a/libgit2-1.1.0/headers/git2/refdb.h b/libgit2/headers/git2/refdb.h similarity index 100% rename from libgit2-1.1.0/headers/git2/refdb.h rename to libgit2/headers/git2/refdb.h diff --git a/libgit2-1.1.0/headers/git2/reflog.h b/libgit2/headers/git2/reflog.h similarity index 100% rename from libgit2-1.1.0/headers/git2/reflog.h rename to libgit2/headers/git2/reflog.h diff --git a/libgit2-1.1.0/headers/git2/refs.h b/libgit2/headers/git2/refs.h similarity index 99% rename from libgit2-1.1.0/headers/git2/refs.h rename to libgit2/headers/git2/refs.h index c9cce22..66970c5 100644 --- a/libgit2-1.1.0/headers/git2/refs.h +++ b/libgit2/headers/git2/refs.h @@ -169,7 +169,7 @@ GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repositor * * The message for the reflog will be ignored if the reference does * not belong in the standard set (HEAD, branches and remote-tracking - * branches) and and it does not have a reflog. + * branches) and it does not have a reflog. * * @param out Pointer to the newly created reference * @param repo Repository where that reference will live @@ -206,7 +206,7 @@ GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, * * The message for the reflog will be ignored if the reference does * not belong in the standard set (HEAD, branches and remote-tracking - * branches) and and it does not have a reflog. + * branches) and it does not have a reflog. * * It will return GIT_EMODIFIED if the reference's value at the time * of updating does not match the one passed through `current_id` @@ -318,7 +318,7 @@ GIT_EXTERN(git_repository *) git_reference_owner(const git_reference *ref); * * The message for the reflog will be ignored if the reference does * not belong in the standard set (HEAD, branches and remote-tracking - * branches) and and it does not have a reflog. + * branches) and it does not have a reflog. * * @param out Pointer to the newly created reference * @param ref The reference diff --git a/libgit2-1.1.0/headers/git2/refspec.h b/libgit2/headers/git2/refspec.h similarity index 100% rename from libgit2-1.1.0/headers/git2/refspec.h rename to libgit2/headers/git2/refspec.h diff --git a/libgit2-1.1.0/headers/git2/remote.h b/libgit2/headers/git2/remote.h similarity index 100% rename from libgit2-1.1.0/headers/git2/remote.h rename to libgit2/headers/git2/remote.h diff --git a/libgit2-1.1.0/headers/git2/repository.h b/libgit2/headers/git2/repository.h similarity index 90% rename from libgit2-1.1.0/headers/git2/repository.h rename to libgit2/headers/git2/repository.h index 9ddcd34..45becc7 100644 --- a/libgit2-1.1.0/headers/git2/repository.h +++ b/libgit2/headers/git2/repository.h @@ -219,36 +219,54 @@ GIT_EXTERN(int) git_repository_init( * * These flags configure extra behaviors to `git_repository_init_ext`. * In every case, the default behavior is the zero value (i.e. flag is - * not set). Just OR the flag values together for the `flags` parameter - * when initializing a new repo. Details of individual values are: - * - * * BARE - Create a bare repository with no working directory. - * * NO_REINIT - Return an GIT_EEXISTS error if the repo_path appears to - * already be an git repository. - * * NO_DOTGIT_DIR - Normally a "/.git/" will be appended to the repo - * path for non-bare repos (if it is not already there), but - * passing this flag prevents that behavior. - * * MKDIR - Make the repo_path (and workdir_path) as needed. Init is - * always willing to create the ".git" directory even without this - * flag. This flag tells init to create the trailing component of - * the repo and workdir paths as needed. - * * MKPATH - Recursively make all components of the repo and workdir - * paths as necessary. - * * EXTERNAL_TEMPLATE - libgit2 normally uses internal templates to - * initialize a new repo. This flags enables external templates, - * looking the "template_path" from the options if set, or the - * `init.templatedir` global config if not, or falling back on - * "/usr/share/git-core/templates" if it exists. - * * GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is - * specified, use relative paths for the gitdir and core.worktree. + * not set). Just OR the flag values together for the `flags` parameter + * when initializing a new repo. */ typedef enum { + /** + * Create a bare repository with no working directory. + */ GIT_REPOSITORY_INIT_BARE = (1u << 0), + + /** + * Return an GIT_EEXISTS error if the repo_path appears to already be + * an git repository. + */ GIT_REPOSITORY_INIT_NO_REINIT = (1u << 1), + + /** + * Normally a "/.git/" will be appended to the repo path for + * non-bare repos (if it is not already there), but passing this flag + * prevents that behavior. + */ GIT_REPOSITORY_INIT_NO_DOTGIT_DIR = (1u << 2), + + /** + * Make the repo_path (and workdir_path) as needed. Init is always willing + * to create the ".git" directory even without this flag. This flag tells + * init to create the trailing component of the repo and workdir paths + * as needed. + */ GIT_REPOSITORY_INIT_MKDIR = (1u << 3), + + /** + * Recursively make all components of the repo and workdir paths as + * necessary. + */ GIT_REPOSITORY_INIT_MKPATH = (1u << 4), + + /** + * libgit2 normally uses internal templates to initialize a new repo. + * This flags enables external templates, looking the "template_path" from + * the options if set, or the `init.templatedir` global config if not, + * or falling back on "/usr/share/git-core/templates" if it exists. + */ GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE = (1u << 5), + + /** + * If an alternate workdir is specified, use relative paths for the gitdir + * and core.worktree. + */ GIT_REPOSITORY_INIT_RELATIVE_GITLINK = (1u << 6), } git_repository_init_flag_t; @@ -257,17 +275,23 @@ typedef enum { * * Set the mode field of the `git_repository_init_options` structure * either to the custom mode that you would like, or to one of the - * following modes: - * - * * SHARED_UMASK - Use permissions configured by umask - the default. - * * SHARED_GROUP - Use "--shared=group" behavior, chmod'ing the new repo - * to be group writable and "g+sx" for sticky group assignment. - * * SHARED_ALL - Use "--shared=all" behavior, adding world readability. - * * Anything else - Set to custom value. + * defined modes. */ typedef enum { + /** + * Use permissions configured by umask - the default. + */ GIT_REPOSITORY_INIT_SHARED_UMASK = 0, + + /** + * Use "--shared=group" behavior, chmod'ing the new repo to be group + * writable and "g+sx" for sticky group assignment. + */ GIT_REPOSITORY_INIT_SHARED_GROUP = 0002775, + + /** + * Use "--shared=all" behavior, adding world readability. + */ GIT_REPOSITORY_INIT_SHARED_ALL = 0002777, } git_repository_init_mode_t; @@ -275,38 +299,57 @@ typedef enum { * Extended options structure for `git_repository_init_ext`. * * This contains extra options for `git_repository_init_ext` that enable - * additional initialization features. The fields are: - * - * * flags - Combination of GIT_REPOSITORY_INIT flags above. - * * mode - Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... - * constants above, or to a custom value that you would like. - * * workdir_path - The path to the working dir or NULL for default (i.e. - * repo_path parent on non-bare repos). IF THIS IS RELATIVE PATH, - * IT WILL BE EVALUATED RELATIVE TO THE REPO_PATH. If this is not - * the "natural" working directory, a .git gitlink file will be - * created here linking to the repo_path. - * * description - If set, this will be used to initialize the "description" - * file in the repository, instead of using the template content. - * * template_path - When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, - * this contains the path to use for the template directory. If - * this is NULL, the config or default directory options will be - * used instead. - * * initial_head - The name of the head to point HEAD at. If NULL, then - * this will be treated as "master" and the HEAD ref will be set - * to "refs/heads/master". If this begins with "refs/" it will be - * used verbatim; otherwise "refs/heads/" will be prefixed. - * * origin_url - If this is non-NULL, then after the rest of the - * repository initialization is completed, an "origin" remote - * will be added pointing to this URL. + * additional initialization features. */ typedef struct { unsigned int version; + + /** + * Combination of GIT_REPOSITORY_INIT flags above. + */ uint32_t flags; + + /** + * Set to one of the standard GIT_REPOSITORY_INIT_SHARED_... constants + * above, or to a custom value that you would like. + */ uint32_t mode; + + /** + * The path to the working dir or NULL for default (i.e. repo_path parent + * on non-bare repos). IF THIS IS RELATIVE PATH, IT WILL BE EVALUATED + * RELATIVE TO THE REPO_PATH. If this is not the "natural" working + * directory, a .git gitlink file will be created here linking to the + * repo_path. + */ const char *workdir_path; + + /** + * If set, this will be used to initialize the "description" file in the + * repository, instead of using the template content. + */ const char *description; + + /** + * When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains + * the path to use for the template directory. If this is NULL, the config + * or default directory options will be used instead. + */ const char *template_path; + + /** + * The name of the head to point HEAD at. If NULL, then this will be + * treated as "master" and the HEAD ref will be set to "refs/heads/master". + * If this begins with "refs/" it will be used verbatim; + * otherwise "refs/heads/" will be prefixed. + */ const char *initial_head; + + /** + * If this is non-NULL, then after the rest of the repository + * initialization is completed, an "origin" remote will be added + * pointing to this URL. + */ const char *origin_url; } git_repository_init_options; diff --git a/libgit2-1.1.0/headers/git2/reset.h b/libgit2/headers/git2/reset.h similarity index 100% rename from libgit2-1.1.0/headers/git2/reset.h rename to libgit2/headers/git2/reset.h diff --git a/libgit2-1.1.0/headers/git2/revert.h b/libgit2/headers/git2/revert.h similarity index 100% rename from libgit2-1.1.0/headers/git2/revert.h rename to libgit2/headers/git2/revert.h diff --git a/libgit2-1.1.0/headers/git2/revparse.h b/libgit2/headers/git2/revparse.h similarity index 100% rename from libgit2-1.1.0/headers/git2/revparse.h rename to libgit2/headers/git2/revparse.h diff --git a/libgit2-1.1.0/headers/git2/revwalk.h b/libgit2/headers/git2/revwalk.h similarity index 100% rename from libgit2-1.1.0/headers/git2/revwalk.h rename to libgit2/headers/git2/revwalk.h diff --git a/libgit2-1.1.0/headers/git2/signature.h b/libgit2/headers/git2/signature.h similarity index 100% rename from libgit2-1.1.0/headers/git2/signature.h rename to libgit2/headers/git2/signature.h diff --git a/libgit2-1.1.0/headers/git2/stash.h b/libgit2/headers/git2/stash.h similarity index 100% rename from libgit2-1.1.0/headers/git2/stash.h rename to libgit2/headers/git2/stash.h diff --git a/libgit2-1.1.0/headers/git2/status.h b/libgit2/headers/git2/status.h similarity index 100% rename from libgit2-1.1.0/headers/git2/status.h rename to libgit2/headers/git2/status.h diff --git a/libgit2-1.1.0/headers/git2/stdint.h b/libgit2/headers/git2/stdint.h similarity index 100% rename from libgit2-1.1.0/headers/git2/stdint.h rename to libgit2/headers/git2/stdint.h diff --git a/libgit2-1.1.0/headers/git2/strarray.h b/libgit2/headers/git2/strarray.h similarity index 100% rename from libgit2-1.1.0/headers/git2/strarray.h rename to libgit2/headers/git2/strarray.h diff --git a/libgit2-1.1.0/headers/git2/submodule.h b/libgit2/headers/git2/submodule.h similarity index 100% rename from libgit2-1.1.0/headers/git2/submodule.h rename to libgit2/headers/git2/submodule.h diff --git a/libgit2-1.1.0/headers/git2/sys/alloc.h b/libgit2/headers/git2/sys/alloc.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/alloc.h rename to libgit2/headers/git2/sys/alloc.h diff --git a/libgit2-1.1.0/headers/git2/sys/commit.h b/libgit2/headers/git2/sys/commit.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/commit.h rename to libgit2/headers/git2/sys/commit.h diff --git a/libgit2-1.1.0/headers/git2/sys/config.h b/libgit2/headers/git2/sys/config.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/config.h rename to libgit2/headers/git2/sys/config.h diff --git a/libgit2-1.1.0/headers/git2/sys/cred.h b/libgit2/headers/git2/sys/cred.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/cred.h rename to libgit2/headers/git2/sys/cred.h diff --git a/libgit2-1.1.0/headers/git2/sys/credential.h b/libgit2/headers/git2/sys/credential.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/credential.h rename to libgit2/headers/git2/sys/credential.h diff --git a/libgit2-1.1.0/headers/git2/sys/diff.h b/libgit2/headers/git2/sys/diff.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/diff.h rename to libgit2/headers/git2/sys/diff.h diff --git a/libgit2-1.1.0/headers/git2/sys/filter.h b/libgit2/headers/git2/sys/filter.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/filter.h rename to libgit2/headers/git2/sys/filter.h diff --git a/libgit2-1.1.0/headers/git2/sys/hashsig.h b/libgit2/headers/git2/sys/hashsig.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/hashsig.h rename to libgit2/headers/git2/sys/hashsig.h diff --git a/libgit2-1.1.0/headers/git2/sys/index.h b/libgit2/headers/git2/sys/index.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/index.h rename to libgit2/headers/git2/sys/index.h diff --git a/libgit2-1.1.0/headers/git2/sys/mempack.h b/libgit2/headers/git2/sys/mempack.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/mempack.h rename to libgit2/headers/git2/sys/mempack.h diff --git a/libgit2-1.1.0/headers/git2/sys/merge.h b/libgit2/headers/git2/sys/merge.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/merge.h rename to libgit2/headers/git2/sys/merge.h diff --git a/libgit2-1.1.0/headers/git2/sys/odb_backend.h b/libgit2/headers/git2/sys/odb_backend.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/odb_backend.h rename to libgit2/headers/git2/sys/odb_backend.h diff --git a/libgit2-1.1.0/headers/git2/sys/openssl.h b/libgit2/headers/git2/sys/openssl.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/openssl.h rename to libgit2/headers/git2/sys/openssl.h diff --git a/libgit2-1.1.0/headers/git2/sys/path.h b/libgit2/headers/git2/sys/path.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/path.h rename to libgit2/headers/git2/sys/path.h diff --git a/libgit2-1.1.0/headers/git2/sys/refdb_backend.h b/libgit2/headers/git2/sys/refdb_backend.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/refdb_backend.h rename to libgit2/headers/git2/sys/refdb_backend.h diff --git a/libgit2-1.1.0/headers/git2/sys/reflog.h b/libgit2/headers/git2/sys/reflog.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/reflog.h rename to libgit2/headers/git2/sys/reflog.h diff --git a/libgit2-1.1.0/headers/git2/sys/refs.h b/libgit2/headers/git2/sys/refs.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/refs.h rename to libgit2/headers/git2/sys/refs.h diff --git a/libgit2-1.1.0/headers/git2/sys/repository.h b/libgit2/headers/git2/sys/repository.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/repository.h rename to libgit2/headers/git2/sys/repository.h diff --git a/libgit2-1.1.0/headers/git2/sys/stream.h b/libgit2/headers/git2/sys/stream.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/stream.h rename to libgit2/headers/git2/sys/stream.h diff --git a/libgit2-1.1.0/headers/git2/sys/transport.h b/libgit2/headers/git2/sys/transport.h similarity index 100% rename from libgit2-1.1.0/headers/git2/sys/transport.h rename to libgit2/headers/git2/sys/transport.h diff --git a/libgit2-1.1.0/headers/git2/tag.h b/libgit2/headers/git2/tag.h similarity index 100% rename from libgit2-1.1.0/headers/git2/tag.h rename to libgit2/headers/git2/tag.h diff --git a/libgit2-1.1.0/headers/git2/trace.h b/libgit2/headers/git2/trace.h similarity index 100% rename from libgit2-1.1.0/headers/git2/trace.h rename to libgit2/headers/git2/trace.h diff --git a/libgit2-1.1.0/headers/git2/transaction.h b/libgit2/headers/git2/transaction.h similarity index 100% rename from libgit2-1.1.0/headers/git2/transaction.h rename to libgit2/headers/git2/transaction.h diff --git a/libgit2-1.1.0/headers/git2/transport.h b/libgit2/headers/git2/transport.h similarity index 95% rename from libgit2-1.1.0/headers/git2/transport.h rename to libgit2/headers/git2/transport.h index fc99ce8..5a27de9 100644 --- a/libgit2-1.1.0/headers/git2/transport.h +++ b/libgit2/headers/git2/transport.h @@ -23,7 +23,7 @@ GIT_BEGIN_DECL /** - * Callback for messages recieved by the transport. + * Callback for messages received by the transport. * * Return a negative value to cancel the network operation. * diff --git a/libgit2-1.1.0/headers/git2/tree.h b/libgit2/headers/git2/tree.h similarity index 99% rename from libgit2-1.1.0/headers/git2/tree.h rename to libgit2/headers/git2/tree.h index 1a8e155..60dec72 100644 --- a/libgit2-1.1.0/headers/git2/tree.h +++ b/libgit2/headers/git2/tree.h @@ -334,6 +334,7 @@ GIT_EXTERN(int) git_treebuilder_insert( * * @param bld Tree builder * @param filename Filename of the entry to remove + * @return 0 or an error code */ GIT_EXTERN(int) git_treebuilder_remove( git_treebuilder *bld, const char *filename); @@ -477,6 +478,7 @@ typedef struct { * @param baseline the tree to base these changes on * @param nupdates the number of elements in the update list * @param updates the list of updates to perform + * @return 0 or an error code */ GIT_EXTERN(int) git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates); diff --git a/libgit2-1.1.0/headers/git2/types.h b/libgit2/headers/git2/types.h similarity index 100% rename from libgit2-1.1.0/headers/git2/types.h rename to libgit2/headers/git2/types.h diff --git a/libgit2-1.1.0/headers/git2/version.h b/libgit2/headers/git2/version.h similarity index 86% rename from libgit2-1.1.0/headers/git2/version.h rename to libgit2/headers/git2/version.h index c1020bb..7b549b0 100644 --- a/libgit2-1.1.0/headers/git2/version.h +++ b/libgit2/headers/git2/version.h @@ -7,10 +7,10 @@ #ifndef INCLUDE_git_version_h__ #define INCLUDE_git_version_h__ -#define LIBGIT2_VERSION "1.1.0" +#define LIBGIT2_VERSION "1.1.1" #define LIBGIT2_VER_MAJOR 1 #define LIBGIT2_VER_MINOR 1 -#define LIBGIT2_VER_REVISION 0 +#define LIBGIT2_VER_REVISION 1 #define LIBGIT2_VER_PATCH 0 #define LIBGIT2_SOVERSION "1.1" diff --git a/libgit2-1.1.0/headers/git2/worktree.h b/libgit2/headers/git2/worktree.h similarity index 100% rename from libgit2-1.1.0/headers/git2/worktree.h rename to libgit2/headers/git2/worktree.h diff --git a/libgit2/libgit2-1.1.1.so b/libgit2/libgit2-1.1.1.so new file mode 100755 index 0000000..266d2fc Binary files /dev/null and b/libgit2/libgit2-1.1.1.so differ diff --git a/pubspec.yaml b/pubspec.yaml index 55251bd..4ca5f21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,10 +14,10 @@ dev_dependencies: path: ^1.8.0 ffigen: - output: "lib/src/libgit2_bindings.dart" + output: "lib/src/bindings/libgit2_bindings.dart" headers: entry-points: - - "libgit2-1.1.0/headers/*.h" + - "libgit2/headers/*.h" name: "Libgit2" description: "Bindings to libgit2" comments: