summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-28 07:35:20 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-29 03:06:16 (GMT)
commit7ba3c078c76cbda00f7ed2ac16a659d8f48631ba (patch)
tree200a059a4cc17a1079ede6af0310e57e6e5826a2 /merge-recursive.c
parenteff73751bb94b0241fd2204effb8680fe9973cbf (diff)
downloadgit-7ba3c078c76cbda00f7ed2ac16a659d8f48631ba.zip
git-7ba3c078c76cbda00f7ed2ac16a659d8f48631ba.tar.gz
git-7ba3c078c76cbda00f7ed2ac16a659d8f48631ba.tar.bz2
Move better_branch_name above get_ref in merge-recursive.
To permit the get_ref function to use the static better_branch_name function to generate a string on demand I'm moving it up earlier. The actual logic was not affected in this change. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index ca4f19e..1c84ed7 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1248,6 +1248,18 @@ static int merge(struct commit *h1,
return clean;
}
+static const char *better_branch_name(const char *branch)
+{
+ static char githead_env[8 + 40 + 1];
+ char *name;
+
+ if (strlen(branch) != 40)
+ return branch;
+ sprintf(githead_env, "GITHEAD_%s", branch);
+ name = getenv(githead_env);
+ return name ? name : branch;
+}
+
static struct commit *get_ref(const char *ref)
{
unsigned char sha1[20];
@@ -1263,18 +1275,6 @@ static struct commit *get_ref(const char *ref)
return (struct commit *)object;
}
-static const char *better_branch_name(const char *branch)
-{
- static char githead_env[8 + 40 + 1];
- char *name;
-
- if (strlen(branch) != 40)
- return branch;
- sprintf(githead_env, "GITHEAD_%s", branch);
- name = getenv(githead_env);
- return name ? name : branch;
-}
-
int main(int argc, char *argv[])
{
static const char *bases[2];