Skip to content
Snippets Groups Projects
Commit cc5631d7 authored by Florian Heck's avatar Florian Heck
Browse files

Merge branch 'master' of gitlab.infosun.fim.uni-passau.de:seibt/GitWrapper

# Conflicts:
#	src/de/uni_passau/fim/gitwrapper/Reference.java
parents 1fa8aef0 e3d5ec6d
No related branches found
No related tags found
1 merge request!5Changes necessary for JDime wrapper script
......@@ -2,6 +2,7 @@ package de.uni_passau.fim.gitwrapper;
import de.uni_passau.fim.processexecutor.ProcessExecutor;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
......@@ -126,6 +127,18 @@ public abstract class Reference {
return revList.map(toParentsList);
}
/**
* Checks whether this {@link Reference} contains the specified file.
*
* @param file
* the (repository relative) path to the file to look for in this {@link Reference}
* @return {@code true} iff this {@link Reference} contains the file
*/
public Optional<Boolean> hasFile(Path file) {
Optional<ProcessExecutor.ExecRes> result = git.exec(repo.getDir(), "cat-file", "-e", id + ":" + file);
return result.map(ProcessExecutor.ExecRes::succeeded);
}
@Override
public final boolean equals(Object o) {
if (this == o) {
......
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