From 4f43731268a85a095e6a0779fc94242f4694e0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 26 Mar 2017 09:42:16 +0700 Subject: [PATCH] files-backend.c: delete dead code in files_ref_iterator_begin() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not in the diff context, but files_downcast() is called before this check. If "refs" is NULL, we would have segfaulted before reaching the check here. And we should never see NULL refs in backend code (frontend should have caught it). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- refs/files-backend.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 42c0cc14f3..caeb8188fd 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1897,9 +1897,6 @@ static struct ref_iterator *files_ref_iterator_begin( struct files_ref_iterator *iter; struct ref_iterator *ref_iterator; - if (!refs) - return empty_ref_iterator_begin(); - if (ref_paranoia < 0) ref_paranoia = git_env_bool("GIT_REF_PARANOIA", 0); if (ref_paranoia)