From: Andrey Loskutov Date: Sun, 28 Jun 2015 18:34:57 +0000 (+0200) Subject: Fixed javadoc: the getBranch() and getFullBranch() can return null X-Git-Tag: v4.1.0.201509280440-r~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=204da3969e51d0e36b59924d697787ae9578332e;p=jgit.git Fixed javadoc: the getBranch() and getFullBranch() can return null Change-Id: I284a1b5f8220f68496f992b0e97e6934e03ae616 Signed-off-by: Andrey Loskutov --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index fc7dca2d43..d4c72cb9cb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -849,8 +849,9 @@ public abstract class Repository implements AutoCloseable { * Except when HEAD is detached, in which case this method returns the * current ObjectId in hexadecimal string format. * - * @return name of current branch (for example {@code refs/heads/master}) or - * an ObjectId in hex format if the current branch is detached. + * @return name of current branch (for example {@code refs/heads/master}), + * an ObjectId in hex format if the current branch is detached, + * or null if the repository is corrupt and has no HEAD reference. * @throws IOException */ public String getFullBranch() throws IOException { @@ -871,8 +872,9 @@ public abstract class Repository implements AutoCloseable { * leading prefix {@code refs/heads/} is removed from the reference before * it is returned to the caller. * - * @return name of current branch (for example {@code master}), or an - * ObjectId in hex format if the current branch is detached. + * @return name of current branch (for example {@code master}), an + * ObjectId in hex format if the current branch is detached, + * or null if the repository is corrupt and has no HEAD reference. * @throws IOException */ public String getBranch() throws IOException {