git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fetch-pack: check parse_commit/object results
@ 2008-03-03  6:31 Martin Koegler
  0 siblings, 0 replies; only message in thread
From: Martin Koegler @ 2008-03-03  6:31 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Martin Koegler

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
Resent with other subject, as the last was rejected by the mailing list.

 builtin-fetch-pack.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/builtin-fetch-pack.c b/builtin-fetch-pack.c
index b23e886..423d637 100644
--- a/builtin-fetch-pack.c
+++ b/builtin-fetch-pack.c
@@ -41,7 +41,8 @@ static void rev_list_push(struct commit *commit, int mark)
 		commit->object.flags |= mark;
 
 		if (!(commit->object.parsed))
-			parse_commit(commit);
+			if (parse_commit(commit))
+				return;
 
 		insert_by_date(commit, &rev_list);
 
@@ -83,7 +84,8 @@ static void mark_common(struct commit *commit,
 			if (!ancestors_only && !(o->flags & POPPED))
 				non_common_revs--;
 			if (!o->parsed && !dont_parse)
-				parse_commit(commit);
+				if (parse_commit(commit))
+					return;
 
 			for (parents = commit->parents;
 					parents;
@@ -103,20 +105,20 @@ static const unsigned char* get_rev(void)
 
 	while (commit == NULL) {
 		unsigned int mark;
-		struct commit_list* parents;
+		struct commit_list *parents = 0;
 
 		if (rev_list == NULL || non_common_revs == 0)
 			return NULL;
 
 		commit = rev_list->item;
 		if (!(commit->object.parsed))
-			parse_commit(commit);
+			if (!parse_commit(commit))
+				parents = commit->parents;
+
 		commit->object.flags |= POPPED;
 		if (!(commit->object.flags & COMMON))
 			non_common_revs--;
 
-		parents = commit->parents;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-03  6:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-03  6:31 [PATCH] fetch-pack: check parse_commit/object results Martin Koegler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).