Skip to content

Commit

Permalink
Make Reference.getFullName return Optional<String> (#6776)
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra authored May 9, 2023
1 parent 42744df commit 1ee0d7e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Optional;
import org.immutables.value.Value;

/**
Expand Down Expand Up @@ -46,13 +47,14 @@ public interface Reference {
/**
* The full name of the reference, e.g. "refs/heads/branch1".
*
* <p>Full names are unique across all reference types.
* <p>Full names are unique across all reference types. If the reference was detached however,
* this will return empty.
*
* <p>The reference type can be inferred from the full name; e.g. if the full name starts with
* "refs/heads/", then the reference is a branch. If the full name starts with "refs/tags/", then
* the reference is a tag.
*/
String getFullName();
Optional<String> getFullName();

/**
* The type of the reference. This is usually either {@value #BRANCH} or {@value #TAG}, but more
Expand Down

0 comments on commit 1ee0d7e

Please sign in to comment.