|
|
@ -124,11 +124,8 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> { |
|
|
|
if (head == null) |
|
|
|
if (head == null) |
|
|
|
throw new NoHeadException(JGitText.get().cannotReadTree); |
|
|
|
throw new NoHeadException(JGitText.get().cannotReadTree); |
|
|
|
CanonicalTreeParser p = new CanonicalTreeParser(); |
|
|
|
CanonicalTreeParser p = new CanonicalTreeParser(); |
|
|
|
ObjectReader reader = repo.newObjectReader(); |
|
|
|
try (ObjectReader reader = repo.newObjectReader()) { |
|
|
|
try { |
|
|
|
|
|
|
|
p.reset(reader, head); |
|
|
|
p.reset(reader, head); |
|
|
|
} finally { |
|
|
|
|
|
|
|
reader.release(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
oldTree = p; |
|
|
|
oldTree = p; |
|
|
|
} |
|
|
|
} |
|
|
@ -159,7 +156,7 @@ public class DiffCommand extends GitCommand<List<DiffEntry>> { |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
throw new JGitInternalException(e.getMessage(), e); |
|
|
|
throw new JGitInternalException(e.getMessage(), e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
diffFmt.release(); |
|
|
|
diffFmt.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|