aboutsummaryrefslogtreecommitdiff
path: root/diffcore-break.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-12-14 17:30:03 -0800
committerJunio C Hamano <junkio@cox.net>2005-12-14 17:30:03 -0800
commit1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0 (patch)
treef65b929c006c31043213152752ea0c80bf08b9e5 /diffcore-break.c
parenta9572072f0ab0ac97e64b0dc01254a3ad95befe1 (diff)
parent294c695d8cfbcf95a5c33fc6ba386f496964defb (diff)
downloadgit-1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0.tar.gz
git-1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0.tar.xz
GIT 0.99.9n aka 1.0rc6v1.0rc6v0.99.9n
Oh, I hate to do this but I ended up merging big usage string cleanups from Fredrik, git-am enhancements that made a lot of sense for non mbox users from HPA, and rebase changes (done independently by me and Lukas) among other things, so git is still in perpetual state of 1.0rc. 1.0 will probably be next Wednesday, but who knows. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diffcore-break.c')
-rw-r--r--diffcore-break.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/diffcore-break.c b/diffcore-break.c
index 06f9a7f0e..c57513a4f 100644
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -62,10 +62,14 @@ static int should_break(struct diff_filespec *src,
return 0; /* error but caught downstream */
base_size = ((src->size < dst->size) ? src->size : dst->size);
+ if (base_size < MINIMUM_BREAK_SIZE)
+ return 0; /* we do not break too small filepair */
delta = diff_delta(src->data, src->size,
dst->data, dst->size,
&delta_size, 0);
+ if (!delta)
+ return 0; /* error but caught downstream */
/* Estimate the edit size by interpreting delta. */
if (count_delta(delta, delta_size,
@@ -168,8 +172,7 @@ void diffcore_break(int break_score)
!S_ISDIR(p->one->mode) && !S_ISDIR(p->two->mode) &&
!strcmp(p->one->path, p->two->path)) {
if (should_break(p->one, p->two,
- break_score, &score) &&
- MINIMUM_BREAK_SIZE <= p->one->size) {
+ break_score, &score)) {
/* Split this into delete and create */
struct diff_filespec *null_one, *null_two;
struct diff_filepair *dp;