mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-07 09:54:37 +00:00
API updates for status.h
This commit is contained in:
parent
9daf240053
commit
d574de0e6e
@ -46,6 +46,18 @@ typedef enum {
|
|||||||
GIT_STATUS_IGNORED = (1u << 14),
|
GIT_STATUS_IGNORED = (1u << 14),
|
||||||
} git_status_t;
|
} git_status_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function pointer to receive status on individual files
|
||||||
|
*
|
||||||
|
* `path` is the relative path to the file from the root of the repository.
|
||||||
|
*
|
||||||
|
* `status_flags` is a combination of `git_status_t` values that apply.
|
||||||
|
*
|
||||||
|
* `payload` is the value you passed to the foreach function as payload.
|
||||||
|
*/
|
||||||
|
typedef int (*git_status_cb)(
|
||||||
|
const char *path, unsigned int status_flags, void *payload);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gather file statuses and run a callback for each one.
|
* Gather file statuses and run a callback for each one.
|
||||||
*
|
*
|
||||||
@ -63,7 +75,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_status_foreach(
|
GIT_EXTERN(int) git_status_foreach(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
int (*callback)(const char *, unsigned int, void *),
|
git_status_cb callback,
|
||||||
void *payload);
|
void *payload);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,9 +158,10 @@ typedef enum {
|
|||||||
* `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags.
|
* `GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH` is specified in the flags.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
unsigned int version;
|
||||||
git_status_show_t show;
|
git_status_show_t show;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
git_strarray pathspec;
|
git_strarray pathspec;
|
||||||
} git_status_options;
|
} git_status_options;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -168,7 +181,7 @@ typedef struct {
|
|||||||
GIT_EXTERN(int) git_status_foreach_ext(
|
GIT_EXTERN(int) git_status_foreach_ext(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
const git_status_options *opts,
|
const git_status_options *opts,
|
||||||
int (*callback)(const char *, unsigned int, void *),
|
git_status_cb callback,
|
||||||
void *payload);
|
void *payload);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,7 +78,7 @@ static unsigned int workdir_delta2status(git_delta_t workdir_status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int (*cb)(const char *, unsigned int, void *);
|
git_status_cb cb;
|
||||||
void *payload;
|
void *payload;
|
||||||
} status_user_callback;
|
} status_user_callback;
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ static int status_invoke_cb(
|
|||||||
int git_status_foreach_ext(
|
int git_status_foreach_ext(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
const git_status_options *opts,
|
const git_status_options *opts,
|
||||||
int (*cb)(const char *, unsigned int, void *),
|
git_status_cb cb,
|
||||||
void *payload)
|
void *payload)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
@ -178,7 +178,7 @@ cleanup:
|
|||||||
|
|
||||||
int git_status_foreach(
|
int git_status_foreach(
|
||||||
git_repository *repo,
|
git_repository *repo,
|
||||||
int (*callback)(const char *, unsigned int, void *),
|
git_status_cb callback,
|
||||||
void *payload)
|
void *payload)
|
||||||
{
|
{
|
||||||
git_status_options opts;
|
git_status_options opts;
|
||||||
|
Loading…
Reference in New Issue
Block a user