Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitWrapper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Georg Seibt
GitWrapper
Commits
da538e06
Commit
da538e06
authored
8 years ago
by
Georg Seibt
Browse files
Options
Downloads
Patches
Plain Diff
use Path to represent affected file for consistency with the rest of the library
parent
2f9df1fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/de/uni_passau/fim/seibt/gitwrapper/repo/BlameLine.java
+5
-4
5 additions, 4 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/BlameLine.java
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
+2
-2
2 additions, 2 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
with
7 additions
and
6 deletions
src/de/uni_passau/fim/seibt/gitwrapper/repo/BlameLine.java
+
5
−
4
View file @
da538e06
package
de.uni_passau.fim.seibt.gitwrapper.repo
;
package
de.uni_passau.fim.seibt.gitwrapper.repo
;
import
java.io.File
;
import
java.io.File
;
import
java.nio.file.Path
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -27,7 +28,7 @@ public class BlameLine {
...
@@ -27,7 +28,7 @@ public class BlameLine {
/**
/**
* The file in the commit that the line is attributed to.
* 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.
* The actual line from the file.
...
@@ -55,7 +56,7 @@ public class BlameLine {
...
@@ -55,7 +56,7 @@ public class BlameLine {
* @param otherHeaderFields
* @param otherHeaderFields
* other (unrecognized) fields from the 'git blame' commit header
* 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
)
{
Map
<
String
,
String
>
otherHeaderFields
)
{
this
.
commit
=
commit
;
this
.
commit
=
commit
;
...
@@ -84,7 +85,7 @@ public class BlameLine {
...
@@ -84,7 +85,7 @@ public class BlameLine {
* other (unrecognized) fields from the 'git blame' commit header
* other (unrecognized) fields from the 'git blame' commit header
* @return a {@link BlameLine} containing the given header fields
* @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
>
otherHeaderFields
)
{
Map
<
String
,
String
>
other
;
Map
<
String
,
String
>
other
;
...
@@ -118,7 +119,7 @@ public class BlameLine {
...
@@ -118,7 +119,7 @@ public class BlameLine {
String
line
)
{
String
line
)
{
Commit
commit
=
firstOccurrence
.
commit
;
Commit
commit
=
firstOccurrence
.
commit
;
File
file
=
firstOccurrence
.
file
;
Path
file
=
firstOccurrence
.
file
;
Map
<
String
,
String
>
otherHeaderFields
=
firstOccurrence
.
otherHeaderFields
;
Map
<
String
,
String
>
otherHeaderFields
=
firstOccurrence
.
otherHeaderFields
;
return
new
BlameLine
(
commit
,
originalLineNumber
,
finalLineNumber
,
file
,
line
,
otherHeaderFields
);
return
new
BlameLine
(
commit
,
originalLineNumber
,
finalLineNumber
,
file
,
line
,
otherHeaderFields
);
...
...
This diff is collapsed.
Click to expand it.
src/de/uni_passau/fim/seibt/gitwrapper/repo/Repository.java
+
2
−
2
View file @
da538e06
...
@@ -434,7 +434,7 @@ public class Repository {
...
@@ -434,7 +434,7 @@ public class Repository {
ZoneId
authorTZ
=
null
;
ZoneId
authorTZ
=
null
;
ZoneId
committerTZ
=
null
;
ZoneId
committerTZ
=
null
;
File
commitFile
=
null
;
Path
commitFile
=
null
;
Map
<
String
,
String
>
other
=
new
HashMap
<>();
Map
<
String
,
String
>
other
=
new
HashMap
<>();
...
@@ -471,7 +471,7 @@ public class Repository {
...
@@ -471,7 +471,7 @@ public class Repository {
committerTZ
=
ZoneId
.
of
(
lineScanner
.
next
());
committerTZ
=
ZoneId
.
of
(
lineScanner
.
next
());
break
;
break
;
case
FILENAME:
case
FILENAME:
commitFile
=
dir
.
toPath
().
resolve
(
Paths
.
get
(
lineScanner
.
nextLine
().
trim
())
).
toFile
()
;
commitFile
=
Paths
.
get
(
lineScanner
.
nextLine
().
trim
());
break
;
break
;
case
SUMMARY:
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).
// 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).
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment