Skip to content
Snippets Groups Projects
Commit 249c9a26 authored by Simon Barner's avatar Simon Barner
Browse files

Fix computeGitObjectHash() on Linux

* String.length() does not return the expected size

Issue-Ref: 4310
Issue-Url: af3#4310



Signed-off-by: default avatarSimon Barner <barner@fortiss.org>
parent c625f61b
No related branches found
No related tags found
1 merge request!210Setting up Metric extraction plugin for AF3 : Issue 4310
Pipeline #39257 passed
Pipeline: maven-releng

#39258

    CSVFileWriter.java 0cae6203edc159cec0d3f68c61f4b04a3c61eecd RED
    CSVFileWriter.java 7df3c06231037c5026ca7fa18572d935d444ebf7 RED
    ModelQualityStorageManager.java 8293f17743bdc85e2595eae99b978ed868bd029b RED
    ......@@ -233,7 +233,8 @@ public class CSVFileWriter {
    // Construct pre-image (input to hash function) according to Git specification
    String fileContents = inputBuilder.toString();
    int n = fileContents.length();
    // fileContexts.length() does not return the correct length on some platforms (e.g., Linux)
    int n = fileContents.getBytes().length;
    String preImage = "blob " + n + "\0" + fileContents;
    // Compute hash and convert it to a hex string
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment