Skip to content

Commit fd3aeea

Browse files
babourngitster
authored andcommitted
diff-no-index: replace manual "."/".." check with is_dot_or_dotdot()
Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Brian Bourn <ba.bourn@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9daf0ef commit fd3aeea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

diff-no-index.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "log-tree.h"
1616
#include "builtin.h"
1717
#include "string-list.h"
18+
#include "dir.h"
1819

1920
static int read_directory_contents(const char *path, struct string_list *list)
2021
{
@@ -25,7 +26,7 @@ static int read_directory_contents(const char *path, struct string_list *list)
2526
return error("Could not open directory %s", path);
2627

2728
while ((e = readdir(dir)))
28-
if (strcmp(".", e->d_name) && strcmp("..", e->d_name))
29+
if (!is_dot_or_dotdot(e->d_name))
2930
string_list_insert(list, e->d_name);
3031

3132
closedir(dir);

0 commit comments

Comments
 (0)