git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>
Subject: [PATCH] Remove pointless calls to access(2) when checking for .mailmap
Date: Tue, 1 May 2007 00:27:05 +0200	[thread overview]
Message-ID: <20070430222705.GC5000@steel.home> (raw)

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>
---
 builtin-blame.c    |    2 +-
 builtin-shortlog.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/builtin-blame.c b/builtin-blame.c
index 682edba..3442d28 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -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);
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index b57a88a..8d3f742 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -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))
-- 
1.5.2.rc0.792.g7f4bd0

                 reply	other threads:[~2007-04-30 22:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070430222705.GC5000@steel.home \
    --to=raa.lkml@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).