summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bd2035)
raw | patch | inline | side by side (parent: 6bd2035)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 17 May 2006 10:16:27 +0000 (03:16 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 17 May 2006 10:16:27 +0000 (03:16 -0700) |
This does not change the logic but moves the order of checks
around so that merging of read-tree safety code would become
easier.
Signed-off-by: Junio C Hamano <junkio@cox.net>
around so that merging of read-tree safety code would become
easier.
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-tree.c | patch | blob | history |
diff --git a/read-tree.c b/read-tree.c
index 8b91affe899e065349979c8f4b347560ecd0063a..fb1d6829d9e62de541a00dd7c1ab6d7041099255 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
* Bind merge.
*
* Keep the index entries at stage0, collapse stage1 but make sure
- * stage0 does not have anything in prefix.
+ * stage0 does not have anything there.
*/
static int bind_merge(struct cache_entry **src)
{
if (merge_size != 1)
return error("Cannot do a bind merge of %d trees\n",
merge_size);
- if (!a)
- return merged_entry(old, NULL);
- if (old)
+ if (a && old)
die("Entry '%s' overlaps. Cannot bind.", a->name);
-
- return merged_entry(a, NULL);
+ if (!a)
+ return keep_entry(old);
+ else
+ return merged_entry(a, NULL);
}
/*