summaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorGary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-31 23:59:26 (GMT)
commit66dbfd55e38128db02eb340fcd89f54b734d4c6e (patch)
tree115937b86083814adcc97bc55424720e96da5f72 /builtin/checkout.c
parentebef82776512f56eec4b6ac98b076369eb5a93fa (diff)
downloadgit-66dbfd55e38128db02eb340fcd89f54b734d4c6e.zip
git-66dbfd55e38128db02eb340fcd89f54b734d4c6e.tar.gz
git-66dbfd55e38128db02eb340fcd89f54b734d4c6e.tar.bz2
Rewrite dynamic structure initializations to runtime assignment
Unfortunately, there are still plenty of production systems with vendor compilers that choke unless all compound declarations can be determined statically at compile time, for example hpux10.20 (I can provide a comprehensive list of our supported platforms that exhibit this problem if necessary). This patch simply breaks apart any compound declarations with dynamic initialisation expressions, and moves the initialisation until after the last declaration in the same block, in all the places necessary to have the offending compilers accept the code. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 88b1f43..9820351 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -609,7 +609,8 @@ static int check_tracking_name(const char *refname, const unsigned char *sha1,
static const char *unique_tracking_name(const char *name)
{
- struct tracking_name_data cb_data = { name, NULL, 1 };
+ struct tracking_name_data cb_data = { NULL, NULL, 1 };
+ cb_data.name = name;
for_each_ref(check_tracking_name, &cb_data);
if (cb_data.unique)
return cb_data.remote;