aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/MyFirstObjectWalk.txt
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2020-03-28 15:19:13 +0000
committerJunio C Hamano <gitster@pobox.com>2020-03-30 11:16:41 -0700
commite3f53ce5bddc9bc58de32ec435a8695000ad9fe6 (patch)
tree91b68c022406108c0ce785d0a26e1a5549f00b16 /Documentation/MyFirstObjectWalk.txt
parent3bab5d56259722843359702bc27111475437ad2a (diff)
downloadgit-e3f53ce5bddc9bc58de32ec435a8695000ad9fe6.tar.gz
MyFirstObjectWalk: remove unnecessary conditional statement
In the given example, `commit` cannot be `NULL` (because this is the loop condition: if it was `NULL`, the loop body would not be entered at all). It took this developer a moment or two to see that this is therefore dead code. Let's remove it, to avoid puzzling future readers. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/MyFirstObjectWalk.txt')
-rw-r--r--Documentation/MyFirstObjectWalk.txt3
1 files changed, 0 insertions, 3 deletions
diff --git a/Documentation/MyFirstObjectWalk.txt b/Documentation/MyFirstObjectWalk.txt
index aa828dfdc4..c3f2d1a831 100644
--- a/Documentation/MyFirstObjectWalk.txt
+++ b/Documentation/MyFirstObjectWalk.txt
@@ -357,9 +357,6 @@ static void walken_commit_walk(struct rev_info *rev)
...
while ((commit = get_revision(rev))) {
- if (!commit)
- continue;
-
strbuf_reset(&prettybuf);
pp_commit_easy(CMIT_FMT_ONELINE, commit, &prettybuf);
puts(prettybuf.buf);