summaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-20 08:15:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-20 08:15:11 (GMT)
commit4d9e079e826c9b51b610260564111fa8385f7581 (patch)
tree13a4e3a16efd510b3b15a2ce55cf3caeb00857aa /builtin/blame.c
parent583c389e7e431583de4fd8f6c06495a9b015c528 (diff)
parentec7ff5ba272b565ed093a98dc13dd5cd26aeac92 (diff)
downloadgit-4d9e079e826c9b51b610260564111fa8385f7581.zip
git-4d9e079e826c9b51b610260564111fa8385f7581.tar.gz
git-4d9e079e826c9b51b610260564111fa8385f7581.tar.bz2
Merge branch 'zj/decimal-width'
* zj/decimal-width: make lineno_width() from blame reusable for others Conflicts: cache.h pager.c
Diffstat (limited to 'builtin/blame.c')
-rw-r--r--builtin/blame.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 01956c8..b35bd62 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1829,18 +1829,6 @@ static int read_ancestry(const char *graft_file)
}
/*
- * How many columns do we need to show line numbers in decimal?
- */
-static int lineno_width(int lines)
-{
- int i, width;
-
- for (width = 1, i = 10; i <= lines; width++)
- i *= 10;
- return width;
-}
-
-/*
* How many columns do we need to show line numbers, authors,
* and filenames?
*/
@@ -1880,9 +1868,9 @@ static void find_alignment(struct scoreboard *sb, int *option)
if (largest_score < ent_score(sb, e))
largest_score = ent_score(sb, e);
}
- max_orig_digits = lineno_width(longest_src_lines);
- max_digits = lineno_width(longest_dst_lines);
- max_score_digits = lineno_width(largest_score);
+ max_orig_digits = decimal_width(longest_src_lines);
+ max_digits = decimal_width(longest_dst_lines);
+ max_score_digits = decimal_width(largest_score);
}
/*