@ -1060,11 +1060,11 @@ public class Config {
* made to { @code this } .
* made to { @code this } .
* /
* /
public void fromText ( String text ) throws ConfigInvalidException {
public void fromText ( String text ) throws ConfigInvalidException {
state . set ( newState ( fromTextRecurse ( text , 1 ) ) ) ;
state . set ( newState ( fromTextRecurse ( text , 1 , null ) ) ) ;
}
}
private List < ConfigLine > fromTextRecurse ( String text , int depth )
private List < ConfigLine > fromTextRecurse ( String text , int depth ,
throws ConfigInvalidException {
String includedFrom ) throws ConfigInvalidException {
if ( depth > MAX_DEPTH ) {
if ( depth > MAX_DEPTH ) {
throw new ConfigInvalidException (
throw new ConfigInvalidException (
JGitText . get ( ) . tooManyIncludeRecursions ) ;
JGitText . get ( ) . tooManyIncludeRecursions ) ;
@ -1073,6 +1073,7 @@ public class Config {
final StringReader in = new StringReader ( text ) ;
final StringReader in = new StringReader ( text ) ;
ConfigLine last = null ;
ConfigLine last = null ;
ConfigLine e = new ConfigLine ( ) ;
ConfigLine e = new ConfigLine ( ) ;
e . includedFrom = includedFrom ;
for ( ; ; ) {
for ( ; ; ) {
int input = in . read ( ) ;
int input = in . read ( ) ;
if ( - 1 = = input ) {
if ( - 1 = = input ) {
@ -1088,7 +1089,7 @@ public class Config {
if ( e . section ! = null )
if ( e . section ! = null )
last = e ;
last = e ;
e = new ConfigLine ( ) ;
e = new ConfigLine ( ) ;
e . includedFrom = includedFrom ;
} else if ( e . suffix ! = null ) {
} else if ( e . suffix ! = null ) {
// Everything up until the end-of-line is in the suffix.
// Everything up until the end-of-line is in the suffix.
e . suffix + = c ;
e . suffix + = c ;
@ -1173,7 +1174,7 @@ public class Config {
decoded = RawParseUtils . decode ( bytes ) ;
decoded = RawParseUtils . decode ( bytes ) ;
}
}
try {
try {
newEntries . addAll ( fromTextRecurse ( decoded , depth + 1 ) ) ;
newEntries . addAll ( fromTextRecurse ( decoded , depth + 1 , line . value ) ) ;
} catch ( ConfigInvalidException e ) {
} catch ( ConfigInvalidException e ) {
throw new ConfigInvalidException ( MessageFormat
throw new ConfigInvalidException ( MessageFormat
. format ( JGitText . get ( ) . cannotReadFile , line . value ) , e ) ;
. format ( JGitText . get ( ) . cannotReadFile , line . value ) , e ) ;