Commit 332e4f20 by Vicent Marti

Merge pull request #2297 from libgit2/rb/status-with-precomposed-changes

Improve test coverage of status with different core.precomposeunicode settings
parents 2ad51b81 6b833e3a
...@@ -236,6 +236,11 @@ GIT_EXTERN(int) git_status_foreach( ...@@ -236,6 +236,11 @@ GIT_EXTERN(int) git_status_foreach(
* in what order. See the `git_status_options` structure for details * in what order. See the `git_status_options` structure for details
* about the additional controls that this makes available. * about the additional controls that this makes available.
* *
* Note that if a `pathspec` is given in the `git_status_options` to filter
* the status, then the results from rename detection (if you enable it) may
* not be accurate. To do rename detection properly, this must be called
* with no `pathspec` so that all files can be considered.
*
* @param repo Repository object * @param repo Repository object
* @param opts Status options structure * @param opts Status options structure
* @param callback The function to call on each file * @param callback The function to call on each file
...@@ -251,8 +256,20 @@ GIT_EXTERN(int) git_status_foreach_ext( ...@@ -251,8 +256,20 @@ GIT_EXTERN(int) git_status_foreach_ext(
/** /**
* Get file status for a single file. * Get file status for a single file.
* *
* This is not quite the same as calling `git_status_foreach_ext()` with * This tries to get status for the filename that you give. If no files
* the pathspec set to the specified path. * match that name (in either the HEAD, index, or working directory), this
* returns GIT_ENOTFOUND.
*
* If the name matches multiple files (for example, if the `path` names a
* directory or if running on a case- insensitive filesystem and yet the
* HEAD has two entries that both match the path), then this returns
* GIT_EAMBIGUOUS because it cannot give correct results.
*
* This does not do any sort of rename detection. Renames require a set of
* targets and because of the path filtering, there is not enough
* information to check renames correctly. To check file status with rename
* detection, there is no choice but to do a full `git_status_list_new` and
* scan through looking for the path that you are interested in.
* *
* @param status_flags Output combination of git_status_t values for file * @param status_flags Output combination of git_status_t values for file
* @param repo A repository object * @param repo A repository object
...@@ -269,6 +286,11 @@ GIT_EXTERN(int) git_status_file( ...@@ -269,6 +286,11 @@ GIT_EXTERN(int) git_status_file(
/** /**
* Gather file status information and populate the `git_status_list`. * Gather file status information and populate the `git_status_list`.
* *
* Note that if a `pathspec` is given in the `git_status_options` to filter
* the status, then the results from rename detection (if you enable it) may
* not be accurate. To do rename detection properly, this must be called
* with no `pathspec` so that all files can be considered.
*
* @param out Pointer to store the status results in * @param out Pointer to store the status results in
* @param repo Repository object * @param repo Repository object
* @param opts Status options structure * @param opts Status options structure
...@@ -282,6 +304,9 @@ GIT_EXTERN(int) git_status_list_new( ...@@ -282,6 +304,9 @@ GIT_EXTERN(int) git_status_list_new(
/** /**
* Gets the count of status entries in this list. * Gets the count of status entries in this list.
* *
* If there are no changes in status (at least according the options given
* when the status list was created), this can return 0.
*
* @param statuslist Existing status list object * @param statuslist Existing status list object
* @return the number of status entries * @return the number of status entries
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment