Commit b49edddcd0af70caee7eb4905dc26199adccabfd

Edward Thomson 2015-02-18T09:40:52

checkout: let the stream writer close the fd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/checkout.c b/src/checkout.c
index 1585a4f..e48a855 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1397,7 +1397,7 @@ static int checkout_stream_close(git_writestream *s)
 	assert(stream && stream->open);
 
 	stream->open = 0;
-	return 0;
+	return p_close(stream->fd);
 }
 
 static void checkout_stream_free(git_writestream *s)
@@ -1461,7 +1461,6 @@ static int blob_content_to_file(
 	assert(writer.open == 0);
 
 	git_filter_list_free(fl);
-	p_close(fd);
 
 	if (error < 0)
 		return error;