projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update git-daemon's documentation wrt. new options
[git.git]
/
sha1_name.c
diff --git
a/sha1_name.c
b/sha1_name.c
index
75c688e
..
cc320d3
100644
(file)
--- a/
sha1_name.c
+++ b/
sha1_name.c
@@
-323,6
+323,8
@@
static int peel_onion(const char *name, int len, unsigned char *sha1)
return -1;
if (!type_string) {
o = deref_tag(o);
return -1;
if (!type_string) {
o = deref_tag(o);
+ if (!o || (!o->parsed && !parse_object(o->sha1)))
+ return -1;
memcpy(sha1, o->sha1, 20);
}
else {
memcpy(sha1, o->sha1, 20);
}
else {
@@
-332,7
+334,7
@@
static int peel_onion(const char *name, int len, unsigned char *sha1)
*/
while (1) {
*/
while (1) {
- if (!o)
+ if (!o
|| (!o->parsed && !parse_object(o->sha1))
)
return -1;
if (o->type == type_string) {
memcpy(sha1, o->sha1, 20);
return -1;
if (o->type == type_string) {
memcpy(sha1, o->sha1, 20);