git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andy@petdance.com
To: git@vger.kernel.org
Cc: gitster@pobox.com, Andy Lester <andy@petdance.com>
Subject: [PATCH 2/2] Applying const to arg for rev_is_head(). Localized a work variable.
Date: Wed, 22 Apr 2009 01:00:37 -0500	[thread overview]
Message-ID: <1240380037-24785-2-git-send-email-andy@petdance.com> (raw)
In-Reply-To: <1240380037-24785-1-git-send-email-andy@petdance.com>

From: Andy Lester <andy@petdance.com>

---
 builtin-show-branch.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/builtin-show-branch.c b/builtin-show-branch.c
index 828e6f8..549f99a 100644
--- a/builtin-show-branch.c
+++ b/builtin-show-branch.c
@@ -261,7 +261,6 @@ static void show_one_commit(struct commit *commit, int no_name)
 {
 	struct strbuf pretty = STRBUF_INIT;
 	const char *pretty_str = "(unavailable)";
-	struct commit_name *name = commit->util;
 
 	if (commit->object.parsed) {
 		pretty_print_commit(CMIT_FMT_ONELINE, commit,
@@ -272,6 +271,7 @@ static void show_one_commit(struct commit *commit, int no_name)
 		pretty_str += 8;
 
 	if (!no_name) {
+		struct commit_name *name = commit->util;
 		if (name && name->head_name) {
 			printf("[%s", name->head_name);
 			if (name->generation) {
@@ -456,7 +456,7 @@ static void snarf_refs(int head, int remotes)
 	}
 }
 
-static int rev_is_head(char *head, int headlen, char *name,
+static int rev_is_head(const char *head, int headlen, const char *name,
 		       unsigned char *head_sha1, unsigned char *sha1)
 {
 	if ((!head[0]) ||
@@ -548,7 +548,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
 	return git_default_config(var, value, cb);
 }
 
-static int omit_in_dense(struct commit *commit, struct commit **rev, int n)
+static int omit_in_dense(const struct commit *commit, struct commit **rev, int n)
 {
 	/* If the commit is tip of the named branches, do not
 	 * omit it.
-- 
1.6.2.4

      reply	other threads:[~2009-04-22  6:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22  6:00 [PATCH 1/2] Localizing temporary variables andy
2009-04-22  6:00 ` andy [this message]

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=1240380037-24785-2-git-send-email-andy@petdance.com \
    --to=andy@petdance.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).