diff options
author | Elijah Newren <newren@gmail.com> | 2017-11-13 21:15:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-15 05:11:25 +0100 |
commit | d6861d0258df95987696eab6c9bbc138a07190b9 (patch) | |
tree | 7c90efa744c02bcc3f0a81b66ec529ec0870e165 /diffcore-rename.c | |
parent | sequencer: warn when internal merge may be suboptimal due to renameLimit (diff) | |
download | git-d6861d0258df95987696eab6c9bbc138a07190b9.tar.xz git-d6861d0258df95987696eab6c9bbc138a07190b9.zip |
progress: fix progress meters when dealing with lots of work
The possibility of setting merge.renameLimit beyond 2^16 raises the
possibility that the values passed to progress can exceed 2^32.
Use uint64_t, because it "ought to be enough for anybody". :-)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r-- | diffcore-rename.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c index 12dc2a056f..34ec05e091 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -534,7 +534,7 @@ void diffcore_rename(struct diff_options *options) if (options->show_rename_progress) { progress = start_delayed_progress( _("Performing inexact rename detection"), - rename_dst_nr * rename_src_nr); + (uint64_t)rename_dst_nr * (uint64_t)rename_src_nr); } mx = xcalloc(st_mult(NUM_CANDIDATE_PER_DST, num_create), sizeof(*mx)); @@ -571,7 +571,7 @@ void diffcore_rename(struct diff_options *options) diff_free_filespec_blob(two); } dst_cnt++; - display_progress(progress, (i+1)*rename_src_nr); + display_progress(progress, (uint64_t)(i+1)*(uint64_t)rename_src_nr); } stop_progress(&progress); |