rerere: migrate to parse-options API
[gitweb.git] / builtin / checkout.c
index 9d618c21d214b60e71ad6e2986234f95d738db07..a0c00d38787ec406b952fbebd057b83f2cae69b6 100644 (file)
@@ -150,6 +150,10 @@ static int checkout_merged(int pos, struct checkout *state)
        read_mmblob(&ours, active_cache[pos+1]->sha1);
        read_mmblob(&theirs, active_cache[pos+2]->sha1);
 
+       /*
+        * NEEDSWORK: re-create conflicts from merges with
+        * merge.renormalize set, too
+        */
        status = ll_merge(&result_buf, path, &ancestor, "base",
                          &ours, "ours", &theirs, "theirs", 0);
        free(ancestor.ptr);
@@ -496,12 +500,12 @@ static void update_refs_for_switch(struct checkout_opts *opts,
                if (opts->new_orphan_branch) {
                        if (opts->new_branch_log && !log_all_ref_updates) {
                                int temp;
-                               char *log_file;
+                               char log_file[PATH_MAX];
                                char *ref_name = mkpath("refs/heads/%s", opts->new_orphan_branch);
 
                                temp = log_all_ref_updates;
                                log_all_ref_updates = 1;
-                               if (log_ref_setup(ref_name, &log_file)) {
+                               if (log_ref_setup(ref_name, log_file, sizeof(log_file))) {
                                        fprintf(stderr, "Can not do reflog for '%s'\n",
                                            opts->new_orphan_branch);
                                        log_all_ref_updates = temp;
@@ -636,7 +640,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;