checkout: clarify comment

The key point for the if statement is that read_tree_some did not update the entry, because either it doesn't exist in tree-ish or doesn't match the pathspec. Clarify that. Suggested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thomas Gummerer committed Dec 20, 2018 at 13:48 UTC 5160fa05623dc2e9e8348d48b91f1f0bf44d369e
1 file changed +4 -4
builtin/checkout.c
+4 -4
@@ -304,10 +304,10 @@ static int checkout_paths(const struct checkout_opts *opts,
304 continue;
305 if (opts->source_tree && !(ce->ce_flags & CE_UPDATE))
306 /*
307 - * "git checkout tree-ish -- path", but this entry
308 - * is in the original index; it will not be checked
309 - * out to the working tree and it does not matter
310 - * if pathspec matched this entry. We will not do
307 + * "git checkout tree-ish -- path" and this entry
308 + * is in the original index, but is not in tree-ish
309 + * or does not match the pathspec; it will not be
310 + * checked out to the working tree. We will not do
311 * anything to this entry at all.
312 */
313 continue;