summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-05-03 17:16:47 +0700
committerJunio C Hamano <gitster@pobox.com>2017-05-26 12:33:55 +0900
commit02912f477586befaf46e0db4f7c47b52081d5b6d (patch)
treef23ead5b61fa0df9ea0354239152fa14a3875887
parent23a9e0712d76a63c5af1caeb816943f466f0300e (diff)
downloadgit-02912f477586befaf46e0db4f7c47b52081d5b6d.tar.gz
clone: use xfopen() instead of fopen()
copy_alternates() called fopen() without handling errors. By switching to xfopen(), this bug is fixed. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/clone.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index de85b85254..dde4fe73af 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -357,7 +357,7 @@ static void copy_alternates(struct strbuf *src, struct strbuf *dst,
* to turn entries with paths relative to the original
* absolute, so that they can be used in the new repository.
*/
- FILE *in = fopen(src->buf, "r");
+ FILE *in = xfopen(src->buf, "r");
struct strbuf line = STRBUF_INIT;
while (strbuf_getline(&line, in) != EOF) {