X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=read-tree.c;h=ce2bb88f0aae8919f188a0dbc5f3338523151740;hb=debb9d84445239ffbc630611548af630fb8e1e7a;hp=d86cc0263c7d2e23aa88b387b1cf040e1c06d6bc;hpb=32192e6622d78347448cfc0572827d6e64e0de28;p=git.git diff --git a/read-tree.c b/read-tree.c index d86cc026..ce2bb88f 100644 --- a/read-tree.c +++ b/read-tree.c @@ -17,7 +17,7 @@ static int unpack_tree(unsigned char *sha1) buffer = read_object_with_reference(sha1, "tree", &size, NULL); if (!buffer) return -1; - ret = read_tree(buffer, size, stage); + ret = read_tree(buffer, size, stage, NULL); free(buffer); return ret; } @@ -280,6 +280,12 @@ static int threeway_merge(struct cache_entry *stages[4], } /* otherwise we will apply the original rule */ } + /* #14ALT */ + if (a && b && c && same(a, b) && !same(a, c)) { + if (old && same(old, c)) + return merged_entry_allow_dirty(c, old, dst); + /* otherwise the regular rule applies */ + } /* * If we have an entry in the index cache ("old"), then we want * to make sure that it matches any entries in stage 2 ("first @@ -504,7 +510,7 @@ static int read_cache_unmerged(void) return deleted; } -static char *read_tree_usage = "git-read-tree ( | -m [-u] [ []])"; +static const char read_tree_usage[] = "git-read-tree ( | -m [-u] [ []])"; static struct cache_file cache_file; @@ -537,6 +543,7 @@ int main(int argc, char **argv) merge = 1; stage = 1; read_cache_unmerged(); + continue; } /* "-m" stands for "merge", meaning we start in stage 1 */