diff options
author | nulltoken <emeric.fermas@gmail.com> | 2013-09-08 18:25:17 +0200 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-09-10 22:36:13 +0200 |
commit | 209f9b67c4f9b2c5bba26f2bdcbee10cf4e25a6b (patch) | |
tree | bc19fe59de8f13a71f6cba58adb16c9495d69bfa /src/odb_loose.c | |
parent | d0cd6c427a35b257373c7178d1e17d82001e125f (diff) | |
download | libgit2-209f9b67c4f9b2c5bba26f2bdcbee10cf4e25a6b.tar.gz |
odb: Teach loose backend to return EAMBIGUOUS
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r-- | src/odb_loose.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c index ce63f4673..4ff57158d 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -499,7 +499,7 @@ static int fn_locate_object_short_oid(void *state, git_buf *pathbuf) { } if (sstate->found > 1) - return git_odb__error_ambiguous("multiple matches in loose objects"); + return GIT_EAMBIGUOUS; return 0; } @@ -545,12 +545,16 @@ static int locate_object_short_oid( /* Explore directory to find a unique object matching short_oid */ error = git_path_direach( object_location, fn_locate_object_short_oid, &state); - if (error) + + if (error && error != GIT_EUSER) return error; if (!state.found) return git_odb__error_notfound("no matching loose object for prefix", short_oid); + if (state.found > 1) + return git_odb__error_ambiguous("multiple matches in loose objects"); + /* Convert obtained hex formatted oid to raw */ error = git_oid_fromstr(res_oid, (char *)state.res_oid); if (error) |