Skip to content
Snippets Groups Projects
Commit da538e06 authored by Georg Seibt's avatar Georg Seibt :nerd:
Browse files

use Path to represent affected file for consistency with the rest of the library

parent 2f9df1fd
Branches
Tags
No related merge requests found
package de.uni_passau.fim.seibt.gitwrapper.repo;
import java.io.File;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Map;
......@@ -27,7 +28,7 @@ public class BlameLine {
/**
* The file in the commit that the line is attributed to.
*/
public final File file;
public final Path file;
/**
* The actual line from the file.
......@@ -55,7 +56,7 @@ public class BlameLine {
* @param otherHeaderFields
* other (unrecognized) fields from the 'git blame' commit header
*/
private BlameLine(Commit commit, int originalLineNumber, int finalLineNumber, File file, String line,
private BlameLine(Commit commit, int originalLineNumber, int finalLineNumber, Path file, String line,
Map<String, String> otherHeaderFields) {
this.commit = commit;
......@@ -84,7 +85,7 @@ public class BlameLine {
* other (unrecognized) fields from the 'git blame' commit header
* @return a {@link BlameLine} containing the given header fields
*/
static BlameLine firstOccurrence(Commit commit, int originalLineNumber, int finalLineNumber, File file, String line,
static BlameLine firstOccurrence(Commit commit, int originalLineNumber, int finalLineNumber, Path file, String line,
Map<String, String> otherHeaderFields) {
Map<String, String> other;
......@@ -118,7 +119,7 @@ public class BlameLine {
String line) {
Commit commit = firstOccurrence.commit;
File file = firstOccurrence.file;
Path file = firstOccurrence.file;
Map<String, String> otherHeaderFields = firstOccurrence.otherHeaderFields;
return new BlameLine(commit, originalLineNumber, finalLineNumber, file, line, otherHeaderFields);
......
......@@ -434,7 +434,7 @@ public class Repository {
ZoneId authorTZ = null;
ZoneId committerTZ = null;
File commitFile = null;
Path commitFile = null;
Map<String, String> other = new HashMap<>();
......@@ -471,7 +471,7 @@ public class Repository {
committerTZ = ZoneId.of(lineScanner.next());
break;
case FILENAME:
commitFile = dir.toPath().resolve(Paths.get(lineScanner.nextLine().trim())).toFile();
commitFile = Paths.get(lineScanner.nextLine().trim());
break;
case SUMMARY:
// We do not explicitly store the summary of the commit as it is just the first line of its message (for which there is a getter).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment