summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-07-08 18:22:44 +0200
committerVicent Marti <tanoku@gmail.com>2011-07-09 02:40:15 +0200
commitf0ab9fda8b566fffb704527b19556df3ef10738e (patch)
tree5c3f1057babd340fcdb6ab33fb78225d533f87cb /src/oid.c
parentd102bbba46ea29e42eff2793fb46e14fbc597213 (diff)
downloadlibgit2-f0ab9fda8b566fffb704527b19556df3ef10738e.tar.gz
index: Return `GIT_ENOTFOUND` when an entry cannot be opened
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/oid.c b/src/oid.c
index 1f4a652c9..2348d1434 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -341,6 +341,9 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid)
if (os->full)
return GIT_ENOMEM;
+ if (text_oid == NULL)
+ return os->min_length;
+
idx = 0;
is_leaf = 0;