mv: rename check_dir_in_index() to empty_dir_has_sparse_contents()
commit72e59ba19e776abbff7dccbf093c73e43527a339
authorShaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Tue, 9 Aug 2022 12:09:03 +0000 (9 20:09 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2022 20:57:49 +0000 (10 13:57 -0700)
treeaa9f4df881a0438a4d56d9f6d6d7ab0f389e9213
parent5506683deaab4c1475800e9b4cd2c06b8de4de97
mv: rename check_dir_in_index() to empty_dir_has_sparse_contents()

Method check_dir_in_index() introduced in b91a2b6594 (mv: add
check_dir_in_index() and solve general dir check issue, 2022-06-30)
does not describe its intent and behavior well.

Change its name to empty_dir_has_sparse_contents(), which more
precisely describes its purpose.

Reverse the return values, check_dir_in_index() return 0 for success
and 1 for failure; reverse the values so empty_dir_has_sparse_contents()
return 1 for success and 0 for failure. These values are more intuitive
because 1 usually means "has" and 0 means "not found".

Also modify the documentation to better align with the method's
intent and behavior.

Helped-by: Derrick Stolee <derrickstolee@github.com>
Helped-by: Victoria Dye <vdye@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mv.c