aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar David Reiss <dreiss@facebook.com> 2009-08-27 16:39:38 -0700
committerGravatar Junio C Hamano <gitster@pobox.com> 2009-08-27 19:59:00 -0700
commit607a9e8aaa9b1a18f81ae67e40a5c8a5d1a92577 (patch)
tree10f49739f95b341d49bbe981526da7e6e5f6bba5
parente72263a1f88d39a7e3672bbe15a7524f8a3f520a (diff)
downloadgit-607a9e8aaa9b1a18f81ae67e40a5c8a5d1a92577.tar.gz
git-607a9e8aaa9b1a18f81ae67e40a5c8a5d1a92577.zip
Round-down years in "years+months" relative date view
Previously, a commit from 1 year and 7 months ago would display as "2 years, 7 months ago". Signed-off-by: David Reiss <dreiss@facebook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--date.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/date.c b/date.c
index 409a17d464..f011692c2f 100644
--- a/date.c
+++ b/date.c
@@ -135,7 +135,7 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode)
}
/* Give years and months for 5 years or so */
if (diff < 1825) {
- unsigned long years = (diff + 183) / 365;
+ unsigned long years = diff / 365;
unsigned long months = (diff % 365 + 15) / 30;
int n;
n = snprintf(timebuf, sizeof(timebuf), "%lu year%s",