Skip to content

Commit ef9c4dc

Browse files
Kevin Willfordgitster
authored andcommitted
merge-recursive: remove return value from get_files_dirs
The return value of the get_files_dirs call is never being used. Looking at the history of the file and it was originally only being used for debug output statements. Also when read_tree_recursive return value is non zero it is changed to zero. This leads me to believe that it doesn't matter if read_tree_recursive gets an error. Since the debug output has been removed and the caller isn't checking the return value there is no reason to keep calculating and returning a value. Signed-off-by: Kevin Willford <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e336bdc commit ef9c4dc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

merge-recursive.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,11 @@ static int save_files_dirs(const unsigned char *sha1,
328328
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
329329
}
330330

331-
static int get_files_dirs(struct merge_options *o, struct tree *tree)
331+
static void get_files_dirs(struct merge_options *o, struct tree *tree)
332332
{
333-
int n;
334333
struct pathspec match_all;
335334
memset(&match_all, 0, sizeof(match_all));
336-
if (read_tree_recursive(tree, "", 0, 0, &match_all, save_files_dirs, o))
337-
return 0;
338-
n = o->current_file_set.nr + o->current_directory_set.nr;
339-
return n;
335+
read_tree_recursive(tree, "", 0, 0, &match_all, save_files_dirs, o);
340336
}
341337

342338
/*

0 commit comments

Comments
 (0)