{"thread":{"id":"7910","subject":"[PATCH] Remove pointless calls to access(2) when checking for .mailmap","startedAt":"2007-04-30T22:27:05Z","lastAt":"2007-04-30T22:27:05Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"40764","messageId":"20070430222705.GC5000@steel.home","threadId":"7910","inReplyTo":null,"subject":"[PATCH] Remove pointless calls to access(2) when checking for .mailmap","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-04-30T22:27:05Z","receivedAt":"2007-04-30T22:27:05Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"read_mailmap already returns not 0 in case of error, and nothing\nseem to be interested in it. It also is silent about the fact\n(read_mailmap being to chatty would justify the call to access,\nbut there is no point for it to be and it isn't).\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n builtin-blame.c    |    2 +-\n builtin-shortlog.c |    3 +--\n 2 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 682edba..3442d28 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2375,7 +2375,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\tdie(\"reading graft file %s failed: %s\",\n \t\t    revs_file, strerror(errno));\n \n-\tif (!no_mailmap && !access(\".mailmap\", R_OK))\n+\tif (!no_mailmap)\n \t\tread_mailmap(&mailmap, \".mailmap\", NULL);\n \n \tassign_blame(&sb, &revs, opt);\ndiff --git a/builtin-shortlog.c b/builtin-shortlog.c\nindex b57a88a..8d3f742 100644\n--- a/builtin-shortlog.c\n+++ b/builtin-shortlog.c\n@@ -283,8 +283,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)\n \tif (argc > 1)\n \t\tdie (\"unrecognized argument: %s\", argv[1]);\n \n-\tif (!access(\".mailmap\", R_OK))\n-\t\tread_mailmap(&mailmap, \".mailmap\", &common_repo_prefix);\n+\tread_mailmap(&mailmap, \".mailmap\", &common_repo_prefix);\n \n \tif (rev.pending.nr == 0) {\n \t\tif (isatty(0))\n-- \n1.5.2.rc0.792.g7f4bd0\n"}]}