Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 5e2ec37b65..f7b6242914 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -479,10 +479,9 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
* We now know we have on the order of 2^len objects, which
* expects a collision at 2^(len/2). But we also care about hex
* chars, not bits, and there are 4 bits per hex. So all
- * together we need to divide by 2; but we also want to round
- * odd numbers up, hence adding one before dividing.
+ * together we need to divide by 2 and round up.
*/
- len = (len + 1) / 2;
+ len = DIV_ROUND_UP(len, 2);
/*
* For very small repos, we stick with our regular fallback.
*/