Web lists-archives.com

[PATCH 126/194] streaming: allow open_istream to handle arbitrary repositories




Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
---
 streaming.c | 11 ++++++-----
 streaming.h |  3 +--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/streaming.c b/streaming.c
index cd52f517eb..2373395afe 100644
--- a/streaming.c
+++ b/streaming.c
@@ -137,22 +137,23 @@ static enum input_source istream_source(struct repository *r,
 	}
 }
 
-struct git_istream *open_istream_the_repository(const unsigned char *sha1,
+struct git_istream *open_istream(struct repository *r,
+				 const unsigned char *sha1,
 				 enum object_type *type,
 				 unsigned long *size,
 				 struct stream_filter *filter)
 {
 	struct git_istream *st;
 	struct object_info oi = OBJECT_INFO_INIT;
-	const unsigned char *real = lookup_replace_object(the_repository, sha1);
-	enum input_source src = istream_source(the_repository, real, type, &oi);
+	const unsigned char *real = lookup_replace_object(r, sha1);
+	enum input_source src = istream_source(r, real, type, &oi);
 
 	if (src < 0)
 		return NULL;
 
 	st = xmalloc(sizeof(*st));
-	if (open_istream_tbl[src](the_repository, st, &oi, real, type)) {
-		if (open_istream_incore(the_repository, st, &oi, real, type)) {
+	if (open_istream_tbl[src](r, st, &oi, real, type)) {
+		if (open_istream_incore(r, st, &oi, real, type)) {
 			free(st);
 			return NULL;
 		}
diff --git a/streaming.h b/streaming.h
index 9f4d5aeee2..cb36ce4c02 100644
--- a/streaming.h
+++ b/streaming.h
@@ -8,8 +8,7 @@
 /* opaque */
 struct git_istream;
 
-#define open_istream(r, s, t, sz, f) open_istream_##r(s, t, sz, f)
-extern struct git_istream *open_istream_the_repository(const unsigned char *, enum object_type *, unsigned long *, struct stream_filter *);
+extern struct git_istream *open_istream(struct repository *, const unsigned char *, enum object_type *, unsigned long *, struct stream_filter *);
 extern int close_istream(struct git_istream *);
 extern ssize_t read_istream(struct git_istream *, void *, size_t);
 
-- 
2.15.1.433.g936d1b9894.dirty