Skip to content

Commit

Permalink
Merge bf512a2 into 3abe1b7
Browse files Browse the repository at this point in the history
  • Loading branch information
blaenk committed May 18, 2016
2 parents 3abe1b7 + bf512a2 commit 99d2c48
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 83 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repositories.

[dependencies]
url = "1.0"
bitflags = "0.1"
bitflags = "0.7"
libc = "0.2"
libgit2-sys = { path = "libgit2-sys", version = "0.4.3" }

Expand Down
144 changes: 62 additions & 82 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,8 @@ pub enum FileFavor {
}

bitflags! {
#[doc = "
Orderings that may be specified for Revwalk iteration.
"]
flags Sort: u32 {
/// Orderings that may be specified for Revwalk iteration.
pub flags Sort: u32 {
/// Sort the repository contents in no particular ordering.
///
/// This sorting is arbitrary, implementation-specific, and subject to
Expand All @@ -373,10 +371,8 @@ Orderings that may be specified for Revwalk iteration.
}

bitflags! {
#[doc = "
Types of credentials that can be requested by a credential callback.
"]
flags CredentialType: u32 {
/// Types of credentials that can be requested by a credential callback.
pub flags CredentialType: u32 {
#[allow(missing_docs)]
const USER_PASS_PLAINTEXT = raw::GIT_CREDTYPE_USERPASS_PLAINTEXT as u32,
#[allow(missing_docs)]
Expand All @@ -395,10 +391,8 @@ Types of credentials that can be requested by a credential callback.
}

bitflags! {
#[doc = "
Flags for the `flags` field of an IndexEntry.
"]
flags IndexEntryFlag: u16 {
/// Flags for the `flags` field of an IndexEntry.
pub flags IndexEntryFlag: u16 {
/// Set when the `extended_flags` field is valid.
const IDXENTRY_EXTENDED = raw::GIT_IDXENTRY_EXTENDED as u16,
/// "Assume valid" flag
Expand All @@ -407,10 +401,8 @@ Flags for the `flags` field of an IndexEntry.
}

bitflags! {
#[doc = "
Flags for the `extended_flags` field of an IndexEntry.
"]
flags IndexEntryExtendedFlag: u16 {
/// Flags for the `extended_flags` field of an IndexEntry.
pub flags IndexEntryExtendedFlag: u16 {
/// An "intent to add" entry from "git add -N"
const IDXENTRY_INTENT_TO_ADD = raw::GIT_IDXENTRY_INTENT_TO_ADD as u16,
/// Skip the associated worktree file, for sparse checkouts
Expand Down Expand Up @@ -444,10 +436,8 @@ Flags for the `extended_flags` field of an IndexEntry.
}

bitflags! {
#[doc = "
Flags for APIs that add files matching pathspec
"]
flags IndexAddOption: u32 {
/// Flags for APIs that add files matching pathspec
pub flags IndexAddOption: u32 {
#[allow(missing_docs)]
const ADD_DEFAULT = raw::GIT_INDEX_ADD_DEFAULT as u32,
#[allow(missing_docs)]
Expand All @@ -461,10 +451,8 @@ Flags for APIs that add files matching pathspec
}

bitflags! {
#[doc = "
Flags for `Repository::open_ext`
"]
flags RepositoryOpenFlags: u32 {
/// Flags for `Repository::open_ext`
pub flags RepositoryOpenFlags: u32 {
/// Only open the specified path; don't walk upward searching.
const REPOSITORY_OPEN_NO_SEARCH = raw::GIT_REPOSITORY_OPEN_NO_SEARCH as u32,
/// Search across filesystem boundaries.
Expand All @@ -475,10 +463,8 @@ Flags for `Repository::open_ext`
}

bitflags! {
#[doc = "
Flags for the return value of `Repository::revparse`
"]
flags RevparseMode: u32 {
/// Flags for the return value of `Repository::revparse`
pub flags RevparseMode: u32 {
/// The spec targeted a single object
const REVPARSE_SINGLE = raw::GIT_REVPARSE_SINGLE as u32,
/// The spec targeted a range of commits
Expand Down Expand Up @@ -633,7 +619,7 @@ bitflags! {
/// represents the status of file in the index relative to the HEAD, and the
/// `STATUS_WT_*` set of flags represent the status of the file in the
/// working directory relative to the index.
flags Status: u32 {
pub flags Status: u32 {
#[allow(missing_docs)]
const STATUS_CURRENT = raw::GIT_STATUS_CURRENT as u32,

Expand Down Expand Up @@ -667,10 +653,8 @@ bitflags! {
}

bitflags! {
#[doc = "
Mode options for RepositoryInitOptions
"]
flags RepositoryInitMode: u32 {
/// Mode options for RepositoryInitOptions
pub flags RepositoryInitMode: u32 {
/// Use permissions configured by umask - the default
const REPOSITORY_INIT_SHARED_UMASK =
raw::GIT_REPOSITORY_INIT_SHARED_UMASK as u32,
Expand Down Expand Up @@ -712,49 +696,47 @@ pub enum Delta {
}

bitflags! {
#[doc = r#"
Return codes for submodule status.
A combination of these flags will be returned to describe the status of a
submodule. Depending on the "ignore" property of the submodule, some of
the flags may never be returned because they indicate changes that are
supposed to be ignored.
Submodule info is contained in 4 places: the HEAD tree, the index, config
files (both .git/config and .gitmodules), and the working directory. Any
or all of those places might be missing information about the submodule
depending on what state the repo is in. We consider all four places to
build the combination of status flags.
There are four values that are not really status, but give basic info
about what sources of submodule data are available. These will be
returned even if ignore is set to "ALL".
* IN_HEAD - superproject head contains submodule
* IN_INDEX - superproject index contains submodule
* IN_CONFIG - superproject gitmodules has submodule
* IN_WD - superproject workdir has submodule
The following values will be returned so long as ignore is not "ALL".
* INDEX_ADDED - in index, not in head
* INDEX_DELETED - in head, not in index
* INDEX_MODIFIED - index and head don't match
* WD_UNINITIALIZED - workdir contains empty directory
* WD_ADDED - in workdir, not index
* WD_DELETED - in index, not workdir
* WD_MODIFIED - index and workdir head don't match
The following can only be returned if ignore is "NONE" or "UNTRACKED".
* WD_INDEX_MODIFIED - submodule workdir index is dirty
* WD_WD_MODIFIED - submodule workdir has modified files
Lastly, the following will only be returned for ignore "NONE".
* WD_UNTRACKED - wd contains untracked files
"#]
flags SubmoduleStatus: u32 {
/// Return codes for submodule status.
///
/// A combination of these flags will be returned to describe the status of a
/// submodule. Depending on the "ignore" property of the submodule, some of
/// the flags may never be returned because they indicate changes that are
/// supposed to be ignored.
///
/// Submodule info is contained in 4 places: the HEAD tree, the index, config
/// files (both .git/config and .gitmodules), and the working directory. Any
/// or all of those places might be missing information about the submodule
/// depending on what state the repo is in. We consider all four places to
/// build the combination of status flags.
///
/// There are four values that are not really status, but give basic info
/// about what sources of submodule data are available. These will be
/// returned even if ignore is set to "ALL".
///
/// * IN_HEAD - superproject head contains submodule
/// * IN_INDEX - superproject index contains submodule
/// * IN_CONFIG - superproject gitmodules has submodule
/// * IN_WD - superproject workdir has submodule
///
/// The following values will be returned so long as ignore is not "ALL".
///
/// * INDEX_ADDED - in index, not in head
/// * INDEX_DELETED - in head, not in index
/// * INDEX_MODIFIED - index and head don't match
/// * WD_UNINITIALIZED - workdir contains empty directory
/// * WD_ADDED - in workdir, not index
/// * WD_DELETED - in index, not workdir
/// * WD_MODIFIED - index and workdir head don't match
///
/// The following can only be returned if ignore is "NONE" or "UNTRACKED".
///
/// * WD_INDEX_MODIFIED - submodule workdir index is dirty
/// * WD_WD_MODIFIED - submodule workdir has modified files
///
/// Lastly, the following will only be returned for ignore "NONE".
///
/// * WD_UNTRACKED - wd contains untracked files
pub flags SubmoduleStatus: u32 {
#[allow(missing_docs)]
const SUBMODULE_STATUS_IN_HEAD =
raw::GIT_SUBMODULE_STATUS_IN_HEAD as u32,
Expand Down Expand Up @@ -821,7 +803,7 @@ pub enum SubmoduleIgnore {

bitflags! {
/// ...
flags PathspecFlags: u32 {
pub flags PathspecFlags: u32 {
/// Use the default pathspec matching configuration.
const PATHSPEC_DEFAULT = raw::GIT_PATHSPEC_DEFAULT as u32,
/// Force matching to ignore case, otherwise matching will use native
Expand Down Expand Up @@ -849,10 +831,8 @@ bitflags! {
}

bitflags! {
#[doc = "
Types of notifications emitted from checkouts.
"]
flags CheckoutNotificationType: u32 {
/// Types of notifications emitted from checkouts.
pub flags CheckoutNotificationType: u32 {
/// Notification about a conflict.
const CHECKOUT_NOTIFICATION_CONFLICT = raw::GIT_CHECKOUT_NOTIFY_CONFLICT as u32,
/// Notification about a dirty file.
Expand Down Expand Up @@ -883,7 +863,7 @@ pub enum DiffFormat {

bitflags! {
/// Formatting options for diff stats
flags DiffStatsFormat: raw::git_diff_stats_format_t {
pub flags DiffStatsFormat: raw::git_diff_stats_format_t {
/// Don't generate any stats
const DIFF_STATS_NONE = raw::GIT_DIFF_STATS_NONE,
/// Equivalent of `--stat` in git
Expand Down

0 comments on commit 99d2c48

Please sign in to comment.