summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 2575ea77f4..c2805e736b 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -581,8 +581,11 @@ static int handle_one_ref(const char *path,
struct object *object = parse_object(sha1);
if (!object)
return 0;
- if (object->type == OBJ_TAG)
+ if (object->type == OBJ_TAG) {
object = deref_tag(object, path, strlen(path));
+ if (!object)
+ return 0;
+ }
if (object->type != OBJ_COMMIT)
return 0;
insert_by_date((struct commit *)object, list);
@@ -699,7 +702,7 @@ int get_sha1_with_mode(const char *name, unsigned char *sha1, unsigned *mode)
break;
if (ce_stage(ce) == stage) {
hashcpy(sha1, ce->sha1);
- *mode = ntohl(ce->ce_mode);
+ *mode = ce->ce_mode;
return 0;
}
pos++;