diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-12 13:41:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-12 13:41:47 -0700 |
commit | 15af30e72f6b86740d6e155d58bc823df72dd84f (patch) | |
tree | a4aa9484b42573f669f87939ee113f364476a257 | |
parent | 788e98f8c0a09d71bd1ed64a71c941a8d10d91c4 (diff) | |
parent | e7b00c57640fa2bf11e4218b588f51cc5a9a754e (diff) | |
download | git-15af30e72f6b86740d6e155d58bc823df72dd84f.tar.gz |
Merge branch 'jk/diffcore-break-divzero' into maint
* jk/diffcore-break-divzero:
diffcore-break: don't divide by zero
-rw-r--r-- | diffcore-break.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/diffcore-break.c b/diffcore-break.c index 44f8678d22..1d9e530a84 100644 --- a/diffcore-break.c +++ b/diffcore-break.c @@ -68,6 +68,9 @@ static int should_break(struct diff_filespec *src, if (max_size < MINIMUM_BREAK_SIZE) return 0; /* we do not break too small filepair */ + if (!src->size) + return 0; /* we do not let empty files get renamed */ + if (diffcore_count_changes(src, dst, &src->cnt_data, &dst->cnt_data, 0, |