Code

Move better_branch_name above get_ref in merge-recursive.
[git.git] / merge-recursive.c
index ca4f19e34d4216fed7c8110ba8f75585c69f92c7..1c84ed78f2449a1d1ac078700ec7eeccbee45ab2 100644 (file)
@@ -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];