Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
rev-tree now handles commit problems better
author
Petr Baudis
<pasky@ucw.cz>
Wed, 11 May 2005 21:01:20 +0000
(23:01 +0200)
committer
Petr Baudis
<xpasky@machine.sinus.cz>
Wed, 11 May 2005 21:01:20 +0000
(23:01 +0200)
This fixes possible crashes in case of broken commit tree, and makes
rev-tree die in case it cannot parse a given commit.
rev-tree.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
1c9da46
)
diff --git
a/rev-tree.c
b/rev-tree.c
index bfc8b125794d5c7104ed955eb3021c5958fc11b5..c2909da1722b48be394311d9cc70cf78ec81e411 100644
(file)
--- a/
rev-tree.c
+++ b/
rev-tree.c
@@
-51,11
+51,11
@@
void process_commit(unsigned char *sha1)
struct commit_list *parents;
struct commit *obj = lookup_commit(sha1);
- if (obj->object.parsed)
+ if (obj
&& obj
->object.parsed)
return;
+ if (!obj || parse_commit(obj))
+ die("unable to parse commit (%s)", sha1_to_hex(sha1));
- parse_commit(obj);
-
parents = obj->parents;
while (parents) {
process_commit(parents->item->object.sha1);