Package org.eclipse.jgit.lib
Class AbbrevConfig
- java.lang.Object
-
- org.eclipse.jgit.lib.AbbrevConfig
-
public final class AbbrevConfig extends Object
Git configuration option core.abbrev- Since:
- 6.1
-
-
Field Summary
Fields Modifier and Type Field Description static int
MIN_ABBREV
The minimum value of abbrevstatic AbbrevConfig
NO
No abbreviation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
capAbbrev(int len)
Cap configured core.abbrev to range between minimum of 4 and number of hex-digits of a full object id.int
get()
Get the configured abbreviation length for object ids.static AbbrevConfig
parseFromConfig(Repository repo)
Parse string value of core.abbrev git option for a given repositoryString
toString()
-
-
-
Field Detail
-
MIN_ABBREV
public static final int MIN_ABBREV
The minimum value of abbrev- See Also:
- Constant Field Values
-
NO
public static final AbbrevConfig NO
No abbreviation
-
-
Method Detail
-
capAbbrev
public static int capAbbrev(int len)
Cap configured core.abbrev to range between minimum of 4 and number of hex-digits of a full object id.- Parameters:
len
- configured number of hex-digits to abbreviate object ids to- Returns:
- core.abbrev capped to range between minimum of 4 and number of hex-digits of a full object id
-
parseFromConfig
public static AbbrevConfig parseFromConfig(Repository repo) throws InvalidConfigurationException
Parse string value of core.abbrev git option for a given repository- Parameters:
repo
- repository- Returns:
- the parsed AbbrevConfig
- Throws:
InvalidConfigurationException
- if value of core.abbrev is invalid
-
get
public int get()
Get the configured abbreviation length for object ids.- Returns:
- the configured abbreviation length for object ids
-
-