diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-05-07 21:21:48 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-05-08 10:05:27 +0200 |
| commit | 722c08afecfc2a9cb737e711a2bcc5f1a64c2b08 (patch) | |
| tree | 071add290a7fbc7ef5a3a2eb67b0d98aa30c56d4 /src/status.c | |
| parent | 464cf248fd05f76cd377298b98b82132c9088569 (diff) | |
| download | libgit2-722c08afecfc2a9cb737e711a2bcc5f1a64c2b08.tar.gz | |
status: Prevent git_status_file() from returning ENOTFOUND when not applicable
Diffstat (limited to 'src/status.c')
| -rw-r--r-- | src/status.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/status.c b/src/status.c index ff8535c66..546dc863d 100644 --- a/src/status.c +++ b/src/status.c @@ -340,17 +340,17 @@ int git_status_file( assert(status_flags && repo && path); if ((workdir = git_repository_workdir(repo)) == NULL) { - giterr_set(GITERR_OS, "Cannot get file status from bare repo"); - return GIT_ENOTFOUND; + giterr_set(GITERR_INVALID, "Cannot get file status from bare repo"); + return -1; } if (git_buf_joinpath(&temp_path, workdir, path) < 0) return -1; if (git_path_isdir(temp_path.ptr)) { - giterr_set(GITERR_OS, "Cannot get file status for directory '%s'", temp_path.ptr); + giterr_set(GITERR_INVALID, "Cannot get file status for directory '%s'", temp_path.ptr); git_buf_free(&temp_path); - return GIT_ENOTFOUND; + return -1; } e = status_entry_new(NULL, path); |
