diff options
| author | Marc Pegon <pegon.marc@gmail.com> | 2011-05-28 21:24:25 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-01 23:40:41 +0200 |
| commit | ac2b94ad7658b53035b8518842348a083decd418 (patch) | |
| tree | 19c5220d8493f697a4f09557ca4dfafb6cc12b36 /src/object.c | |
| parent | dd453c4dbf9a1fa38530b1f51e079852736b8f66 (diff) | |
| download | libgit2-ac2b94ad7658b53035b8518842348a083decd418.tar.gz | |
Added a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed for oid prefixes (set to 4, like in git). Consequently updated some object lookup methods and their documentation.
Diffstat (limited to 'src/object.c')
| -rw-r--r-- | src/object.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object.c b/src/object.c index e6e976756..db8d2062c 100644 --- a/src/object.c +++ b/src/object.c @@ -104,8 +104,8 @@ int git_object_lookup_short_oid(git_object **object_out, git_repository *repo, c assert(repo && object_out && id); - if (len == 0) - return git__throw(GIT_EAMBIGUOUSOIDPREFIX, "Failed to lookup object. Prefix length should be not be 0."); + if (len < GIT_OID_MINPREFIXLEN) + return git__throw(GIT_EAMBIGUOUSOIDPREFIX, "Failed to lookup object. Prefix length is lower than %d.", GIT_OID_MINPREFIXLEN); if (len > GIT_OID_HEXSZ) { len = GIT_OID_HEXSZ; } |
