|
|
@ -109,7 +109,8 @@ public class AbstractTreeIteratorHandler extends |
|
|
|
try { |
|
|
|
try { |
|
|
|
dirc = DirCache.read(new File(name), FS.DETECTED); |
|
|
|
dirc = DirCache.read(new File(name), FS.DETECTED); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().notAnIndexFile, name), e); |
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
|
|
|
CLIText.get().notAnIndexFile, name), e); |
|
|
|
} |
|
|
|
} |
|
|
|
setter.addValue(new DirCacheIterator(dirc)); |
|
|
|
setter.addValue(new DirCacheIterator(dirc)); |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
@ -119,21 +120,25 @@ public class AbstractTreeIteratorHandler extends |
|
|
|
try { |
|
|
|
try { |
|
|
|
id = clp.getRepository().resolve(name); |
|
|
|
id = clp.getRepository().resolve(name); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new CmdLineException(e.getMessage()); |
|
|
|
throw new CmdLineException(owner, e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (id == null) |
|
|
|
if (id == null) |
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); |
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
|
|
|
CLIText.get().notATree, name)); |
|
|
|
|
|
|
|
|
|
|
|
final CanonicalTreeParser p = new CanonicalTreeParser(); |
|
|
|
final CanonicalTreeParser p = new CanonicalTreeParser(); |
|
|
|
final ObjectReader curs = clp.getRepository().newObjectReader(); |
|
|
|
final ObjectReader curs = clp.getRepository().newObjectReader(); |
|
|
|
try { |
|
|
|
try { |
|
|
|
p.reset(curs, clp.getRevWalk().parseTree(id)); |
|
|
|
p.reset(curs, clp.getRevWalk().parseTree(id)); |
|
|
|
} catch (MissingObjectException e) { |
|
|
|
} catch (MissingObjectException e) { |
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); |
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
|
|
|
CLIText.get().notATree, name)); |
|
|
|
} catch (IncorrectObjectTypeException e) { |
|
|
|
} catch (IncorrectObjectTypeException e) { |
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); |
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
|
|
|
CLIText.get().notATree, name)); |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage())); |
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
|
|
|
CLIText.get().cannotReadBecause, name, e.getMessage())); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
curs.release(); |
|
|
|
curs.release(); |
|
|
|
} |
|
|
|
} |
|
|
|