|
|
|
@ -109,7 +109,8 @@ public class AbstractTreeIteratorHandler extends
|
|
|
|
|
try { |
|
|
|
|
dirc = DirCache.read(new File(name), FS.DETECTED); |
|
|
|
|
} 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)); |
|
|
|
|
return 1; |
|
|
|
@ -119,21 +120,25 @@ public class AbstractTreeIteratorHandler extends
|
|
|
|
|
try { |
|
|
|
|
id = clp.getRepository().resolve(name); |
|
|
|
|
} catch (IOException e) { |
|
|
|
|
throw new CmdLineException(e.getMessage()); |
|
|
|
|
throw new CmdLineException(owner, e.getMessage()); |
|
|
|
|
} |
|
|
|
|
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 ObjectReader curs = clp.getRepository().newObjectReader(); |
|
|
|
|
try { |
|
|
|
|
p.reset(curs, clp.getRevWalk().parseTree(id)); |
|
|
|
|
} 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) { |
|
|
|
|
throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name)); |
|
|
|
|
throw new CmdLineException(owner, MessageFormat.format( |
|
|
|
|
CLIText.get().notATree, name)); |
|
|
|
|
} 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 { |
|
|
|
|
curs.release(); |
|
|
|
|
} |
|
|
|
|