Code

http-push: push <remote> :<branch> deletes remote branch
[git.git] / merge-recursive.c
index c292a77a81d137a3ee73111162c9aa515c975d70..55ef76f5a5f855475f796dfda39fa3417179be8b 100644 (file)
@@ -333,7 +333,7 @@ static struct path_list *get_unmerged(void)
                        item->util = xcalloc(1, sizeof(struct stage_data));
                }
                e = item->util;
-               e->stages[ce_stage(ce)].mode = ntohl(ce->ce_mode);
+               e->stages[ce_stage(ce)].mode = ce->ce_mode;
                hashcpy(e->stages[ce_stage(ce)].sha, ce->sha1);
        }
 
@@ -844,8 +844,9 @@ static int read_merge_config(const char *var, const char *value)
        int namelen;
 
        if (!strcmp(var, "merge.default")) {
-               if (value)
-                       default_ll_merge = strdup(value);
+               if (!value)
+                       return config_error_nonbool(var);
+               default_ll_merge = strdup(value);
                return 0;
        }
 
@@ -878,14 +879,14 @@ static int read_merge_config(const char *var, const char *value)
 
        if (!strcmp("name", ep)) {
                if (!value)
-                       return error("%s: lacks value", var);
+                       return config_error_nonbool(var);
                fn->description = strdup(value);
                return 0;
        }
 
        if (!strcmp("driver", ep)) {
                if (!value)
-                       return error("%s: lacks value", var);
+                       return config_error_nonbool(var);
                /*
                 * merge.<name>.driver specifies the command line:
                 *
@@ -908,7 +909,7 @@ static int read_merge_config(const char *var, const char *value)
 
        if (!strcmp("recursive", ep)) {
                if (!value)
-                       return error("%s: lacks value", var);
+                       return config_error_nonbool(var);
                fn->recursive = strdup(value);
                return 0;
        }
@@ -1672,6 +1673,8 @@ static struct commit *get_ref(const char *ref)
        if (get_sha1(ref, sha1))
                die("Could not resolve ref '%s'", ref);
        object = deref_tag(parse_object(sha1), ref, strlen(ref));
+       if (!object)
+               return NULL;
        if (object->type == OBJ_TREE)
                return make_virtual_commit((struct tree*)object,
                        better_branch_name(ref));