[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[jgit-dev] Diff between working directory and commit
- From: Robert von Burg <eitch@xxxxxxxxxxx>
- Date: Tue, 07 Feb 2012 23:22:29 +0100
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120203 Thunderbird/11.0
I've been trying to find a way to build a diff between the current
working directory (unstaged items) and a certain commit.
In git this seems trivial by adding just saying which commit, but in
jgit i'm lost. This is what I have:
// diff of working directory with last commit
ByteArrayOutputStream out = new ByteArrayOutputStream();
DiffFormatter df = new DiffFormatter(out);
DirCacheIterator oldTree = new
FileTreeIterator newTree = new FileTreeIterator(repository);
System.out.println("Diff:\n" + out.toString() + "\n\n");
and building a diff when i have two objectIds is trivial.
What am I mising?
Robert von Burg <eitch@xxxxxxxxxxx>
dipl. Informatiker in Softwareentwicklung HF / pBac-Eng ODEC
system & network administration