Browse Source

Merge "Prevent NPE if ref can't be resolved when executing ReflogCommand" into stable-3.6

tags/v3.6.0.201412230720-r
Christian Halstrick 9 years ago
parent
commit
c893534059
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java

+ 4
- 0
org.eclipse.jgit/src/org/eclipse/jgit/api/ReflogCommand.java View File

@@ -48,6 +48,7 @@ import java.util.Collection;

import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRefNameException;
import org.eclipse.jgit.api.errors.RefNotFoundException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ReflogEntry;
@@ -97,6 +98,9 @@ public class ReflogCommand extends GitCommand<Collection<ReflogEntry>> {

try {
ReflogReader reader = repo.getReflogReader(ref);
if (reader == null)
throw new RefNotFoundException(MessageFormat.format(
JGitText.get().refNotResolved, ref));
return reader.getReverseEntries();
} catch (IOException e) {
throw new InvalidRefNameException(MessageFormat.format(

Loading…
Cancel
Save