}
/*
- * Returns a index_entry instance which doesn't have to correspond to
+ * Returns an index_entry instance which doesn't have to correspond to
* a real cache entry in Git's index.
*/
static struct stage_data *insert_stage_data(const char *path,
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);
}
void *buf;
unsigned long size;
+ if (S_ISGITLINK(mode))
+ die("cannot read object %s '%s': It is a submodule!",
+ sha1_to_hex(sha), path);
+
buf = read_sha1_file(sha, &type, &size);
if (!buf)
die("cannot read object %s '%s'", sha1_to_hex(sha), path);
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;
}
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:
*
if (!strcmp("recursive", ep)) {
if (!value)
- return error("%s: lacks value", var);
+ return config_error_nonbool(var);
fn->recursive = strdup(value);
return 0;
}
mfi = merge_file(&o, &a, &b,
branch1, branch2);
+ clean_merge = mfi.clean;
if (mfi.clean)
update_file(1, mfi.sha, mfi.mode, path);
+ else if (S_ISGITLINK(mfi.mode))
+ output(1, "CONFLICT (submodule): Merge conflict in %s "
+ "- needs %s", path, sha1_to_hex(b.sha1));
else {
- clean_merge = 0;
output(1, "CONFLICT (%s): Merge conflict in %s",
reason, path);
if (active_cache_changed &&
(write_cache(index_fd, active_cache, active_nr) ||
- close(index_fd) || commit_locked_index(lock)))
+ commit_locked_index(lock)))
die ("unable to write %s", get_index_file());
return clean ? 0: 1;