Re: format-patch broken [Was: fetch and bundle don't work in (semi-)broken repo]

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nicolas Pitre
Date: Thursday, October 21, 2010 - 8:53 pm

On Thu, 21 Oct 2010, Uwe Kleine-König wrote:


No it is not.  In theory both format-patch and fetch/bundle should 
require the exact same information.


Or rather the low-level diff code.

diff --git a/diff.c b/diff.c
index 4732b32..b2839f9 100644
--- a/diff.c
+++ b/diff.c
@@ -2386,10 +2386,14 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
 	}
 	else {
 		enum object_type type;
-		if (size_only)
+		if (size_only) {
 			type = sha1_object_info(s->sha1, &s->size);
-		else {
+			if (type < 0)
+				die("unable to read %s", sha1_to_hex(s->sha1));
+		} else {
 			s->data = read_sha1_file(s->sha1, &type, &s->size);
+			if (!s->data)
+				die("unable to read %s", sha1_to_hex(s->sha1));
 			s->should_free = 1;
 		}
 	}


Nicolas
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fetch and bundle don't work in (semi-)broken repo, Uwe Kleine-König, (Tue Oct 19, 9:09 am)
Re: fetch and bundle don't work in (semi-)broken repo, Jonathan Nieder, (Tue Oct 19, 11:39 am)
Re: fetch and bundle don't work in (semi-)broken repo, Uwe Kleine-König, (Tue Oct 19, 1:11 pm)
Re: fetch and bundle don't work in (semi-)broken repo, Nicolas Pitre, (Tue Oct 19, 1:48 pm)
Re: fetch and bundle don't work in (semi-)broken repo, Jonathan Nieder, (Tue Oct 19, 2:02 pm)
Re: fetch and bundle don't work in (semi-)broken repo, Nicolas Pitre, (Tue Oct 19, 8:06 pm)
Re: fetch and bundle don't work in (semi-)broken repo, Uwe Kleine-König, (Wed Oct 20, 12:41 am)
Re: fetch and bundle don't work in (semi-)broken repo, Uwe Kleine-König, (Wed Oct 20, 12:59 am)
Re: fetch and bundle don't work in (semi-)broken repo, Nicolas Pitre, (Wed Oct 20, 6:38 am)
format-patch broken [Was: fetch and bundle don't work in ( ..., Uwe Kleine-König, (Thu Oct 21, 12:11 am)
Re: format-patch broken [Was: fetch and bundle don't work ..., Uwe Kleine-König, (Thu Oct 21, 1:12 am)
Re: format-patch broken [Was: fetch and bundle don't work ..., Nicolas Pitre, (Thu Oct 21, 8:53 pm)