|
|
@ -234,32 +234,26 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase { |
|
|
|
|
|
|
|
|
|
|
|
private static Map<String, CGitIndexRecord> readLsFiles() throws Exception { |
|
|
|
private static Map<String, CGitIndexRecord> readLsFiles() throws Exception { |
|
|
|
final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<>(); |
|
|
|
final LinkedHashMap<String, CGitIndexRecord> r = new LinkedHashMap<>(); |
|
|
|
final BufferedReader br = new BufferedReader(new InputStreamReader( |
|
|
|
try (BufferedReader br = new BufferedReader(new InputStreamReader( |
|
|
|
new FileInputStream(pathOf("gitgit.lsfiles")), "UTF-8")); |
|
|
|
new FileInputStream(pathOf("gitgit.lsfiles")), "UTF-8"))) { |
|
|
|
try { |
|
|
|
|
|
|
|
String line; |
|
|
|
String line; |
|
|
|
while ((line = br.readLine()) != null) { |
|
|
|
while ((line = br.readLine()) != null) { |
|
|
|
final CGitIndexRecord cr = new CGitIndexRecord(line); |
|
|
|
final CGitIndexRecord cr = new CGitIndexRecord(line); |
|
|
|
r.put(cr.path, cr); |
|
|
|
r.put(cr.path, cr); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
|
|
|
|
br.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return r; |
|
|
|
return r; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static Map<String, CGitLsTreeRecord> readLsTree() throws Exception { |
|
|
|
private static Map<String, CGitLsTreeRecord> readLsTree() throws Exception { |
|
|
|
final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<>(); |
|
|
|
final LinkedHashMap<String, CGitLsTreeRecord> r = new LinkedHashMap<>(); |
|
|
|
final BufferedReader br = new BufferedReader(new InputStreamReader( |
|
|
|
try (BufferedReader br = new BufferedReader(new InputStreamReader( |
|
|
|
new FileInputStream(pathOf("gitgit.lstree")), "UTF-8")); |
|
|
|
new FileInputStream(pathOf("gitgit.lstree")), "UTF-8"))) { |
|
|
|
try { |
|
|
|
|
|
|
|
String line; |
|
|
|
String line; |
|
|
|
while ((line = br.readLine()) != null) { |
|
|
|
while ((line = br.readLine()) != null) { |
|
|
|
final CGitLsTreeRecord cr = new CGitLsTreeRecord(line); |
|
|
|
final CGitLsTreeRecord cr = new CGitLsTreeRecord(line); |
|
|
|
r.put(cr.path, cr); |
|
|
|
r.put(cr.path, cr); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
|
|
|
|
br.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return r; |
|
|
|
return r; |
|
|
|
} |
|
|
|
} |
|
|
|