Skip to content

Commit

Permalink
Remove pointless calls to access(2) when checking for .mailmap
Browse files Browse the repository at this point in the history
read_mailmap already returns not 0 in case of error, and nothing
seem to be interested in it. It also is silent about the fact
(read_mailmap being to chatty would justify the call to access,
but there is no point for it to be and it isn't).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Alex Riesen authored and Junio C Hamano committed Apr 30, 2007
1 parent 8503ee4 commit e44b5d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
die("reading graft file %s failed: %s",
revs_file, strerror(errno));

if (!no_mailmap && !access(".mailmap", R_OK))
if (!no_mailmap)
read_mailmap(&mailmap, ".mailmap", NULL);

assign_blame(&sb, &revs, opt);
Expand Down
3 changes: 1 addition & 2 deletions builtin-shortlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
if (argc > 1)
die ("unrecognized argument: %s", argv[1]);

if (!access(".mailmap", R_OK))
read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);
read_mailmap(&mailmap, ".mailmap", &common_repo_prefix);

if (rev.pending.nr == 0) {
if (isatty(0))
Expand Down

0 comments on commit e44b5d1

Please sign in to comment.