From: Hui Wang <redacted>
This variable check is always true, so it is redundant and need to be
removed.
We can't remove the init value for this variable, since removing
it will introduce building warning:
'base_len' may be used uninitialized in this function.
Signed-off-by: Hui Wang <redacted>
---
sha1_file.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index f7c3408..d12a675 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -255,8 +255,7 @@ static int link_alt_odb_entry(const char * entry, int len, const char * relative
if (!is_absolute_path(entry) && relative_base) {
/* Relative alt-odb */
- if (base_len < 0)
- base_len = strlen(relative_base) + 1;
+ base_len = strlen(relative_base) + 1;
entlen += base_len;
pfxlen += base_len;
}--
1.6.3.1