Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
09d1408c
Commit
09d1408c
authored
Nov 08, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2694 from Therzok/statusFile
git_status_file now takes an exact path.
parents
4e1b3b3b
68182085
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
CHANGELOG.md
+3
-0
include/git2/status.h
+2
-1
src/status.c
+2
-1
tests/status/worktree_init.c
+1
-3
No files found.
CHANGELOG.md
View file @
09d1408c
...
...
@@ -112,3 +112,6 @@ v0.21 + 1
now uint32_t instead of uint16_t. This allows to set them to UINT_MAX,
in effect asking for "infinite" context e.g. to iterate over all the
unmodified lines of a diff.
*
git_status_file now takes an exact path. Use git_status_list_new if
pathspec searching is needed.
include/git2/status.h
View file @
09d1408c
...
...
@@ -281,7 +281,8 @@ GIT_EXTERN(int) git_status_foreach_ext(
*
* @param status_flags Output combination of git_status_t values for file
* @param repo A repository object
* @param path The file to retrieve status for relative to the repo workdir
* @param path The exact path to retrieve status for relative to the
* repository working directory
* @return 0 on success, GIT_ENOTFOUND if the file is not found in the HEAD,
* index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files
* or if it refers to a folder, and -1 on other errors.
...
...
src/status.c
View file @
09d1408c
...
...
@@ -494,7 +494,8 @@ int git_status_file(
GIT_STATUS_OPT_RECURSE_IGNORED_DIRS
|
GIT_STATUS_OPT_INCLUDE_UNTRACKED
|
GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS
|
GIT_STATUS_OPT_INCLUDE_UNMODIFIED
;
GIT_STATUS_OPT_INCLUDE_UNMODIFIED
|
GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH
;
opts
.
pathspec
.
count
=
1
;
opts
.
pathspec
.
strings
=
&
sfi
.
expected
;
...
...
tests/status/worktree_init.c
View file @
09d1408c
...
...
@@ -195,9 +195,7 @@ void test_status_worktree_init__bracket_in_filename(void)
cl_git_pass
(
git_status_file
(
&
status_flags
,
repo
,
"LICENSE
\\
[1
\\
].md"
));
cl_assert
(
status_flags
==
GIT_STATUS_INDEX_NEW
);
error
=
git_status_file
(
&
status_flags
,
repo
,
FILE_WITH_BRACKET
);
cl_git_fail
(
error
);
cl_assert_equal_i
(
GIT_EAMBIGUOUS
,
error
);
cl_git_pass
(
git_status_file
(
&
status_flags
,
repo
,
FILE_WITH_BRACKET
));
git_index_free
(
index
);
git_repository_free
(
repo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment