projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] New git-apply test cases for scanning forwards and backwards.
[git.git]
/
read-tree.c
diff --git
a/read-tree.c
b/read-tree.c
index
d86cc02
..
ce2bb88
100644
(file)
--- 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;
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;
}
free(buffer);
return ret;
}
@@
-280,6
+280,12
@@
static int threeway_merge(struct cache_entry *stages[4],
}
/* otherwise we will apply the original rule */
}
}
/* 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
/*
* 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;
}
return deleted;
}
-static c
har *read_tree_usage
= "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
+static c
onst char read_tree_usage[]
= "git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])";
static struct cache_file cache_file;
static struct cache_file cache_file;
@@
-537,6
+543,7
@@
int main(int argc, char **argv)
merge = 1;
stage = 1;
read_cache_unmerged();
merge = 1;
stage = 1;
read_cache_unmerged();
+ continue;
}
/* "-m" stands for "merge", meaning we start in stage 1 */
}
/* "-m" stands for "merge", meaning we start in stage 1 */