summaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-07-18 16:26:55 +0200
committeryorah <yoram.harmelin@gmail.com>2012-07-24 14:03:09 +0200
commitffbc689c8768c66cddf9ef3ab6c88c41ecf4c1ab (patch)
tree4b8a9a6f2576a1787eb26fdae1c3ce0751938806 /src/status.c
parente5e71f5e1db75075a81881f38b4ee0013fa966be (diff)
downloadlibgit2-ffbc689c8768c66cddf9ef3ab6c88c41ecf4c1ab.tar.gz
Fix getting status of files containing brackets
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/status.c b/src/status.c
index e9ad3cfe4..633082c09 100644
--- a/src/status.c
+++ b/src/status.c
@@ -176,10 +176,12 @@ static int get_one_status(const char *path, unsigned int status, void *data)
sfi->count++;
sfi->status = status;
- if (sfi->count > 1 || strcmp(sfi->expected, path) != 0) {
+ if (sfi->count > 1 ||
+ (strcmp(sfi->expected, path) != 0 &&
+ p_fnmatch(sfi->expected, path, 0) != 0)) {
giterr_set(GITERR_INVALID,
"Ambiguous path '%s' given to git_status_file", sfi->expected);
- return -1;
+ return GIT_EAMBIGUOUS;
}
return 0;