Thread (234 messages) flat view 234 messages, 5 authors, 2017-04-07
STALE3454d

Revision v7 of 7 in this series.

Revisions (7)
  1. rfc [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v4 [diff vs current]
  5. v5 [diff vs current]
  6. v6 [diff vs current]
  7. v7 current

[PATCH v7 03/28] files-backend.c: delete dead code in files_ref_iterator_begin()

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2017-03-26 02:43:38
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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)
-- 
2.11.0.157.gd943d85
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help