}
/*
- * 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,
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);
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;