Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Missing blob when doing a git diff with jgit
Missing blob when doing a git diff with jgit [message #1764492] Tue, 30 May 2017 13:34
Thibault beziers la fosse is currently offline Thibault beziers la fosseFriend
Messages: 10
Registered: February 2017
Junior Member
Hello, I'm trying to list all the line modified in a git repository using jgit.

I created a simple maven project "Test", ran:

git init
git add src/*
git commit -am "first commit"


And then finally did a simple code modification to have an output when running
git diff


From an other Java project, I run the following code, in order to list the lines modified in the "Test" project.

repository = new FileRepositoryBuilder().setGitDir(/* Test project .git file */).build();
Git git = new Git(repository);
List<DiffEntry> entries = git.diff().call();
DiffFormatter diffFormatter = new DiffFormatter(System.out);
diffFormatter.setRepository(repository);
diffFormatter.toFileHeader(entries.get(0));


Nonetheless I only obtain the following error:
org.eclipse.jgit.errors.MissingObjectException: Missing blob 07c5f824f6b780ee405823f793248846a0e9e11e
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:164)
	at org.eclipse.jgit.diff.ContentSource$ObjectReaderSource.open(ContentSource.java:144)
	at org.eclipse.jgit.diff.ContentSource$Pair.open(ContentSource.java:280)
	at org.eclipse.jgit.diff.DiffFormatter.open(DiffFormatter.java:1040)
	at org.eclipse.jgit.diff.DiffFormatter.createFormatResult(DiffFormatter.java:968)
	at org.eclipse.jgit.diff.DiffFormatter.toFileHeader(DiffFormatter.java:933)


My git deposit is quite simple, thus I don't understand what is wrong in my code. Tell me if you need more informations.

Best regards,

Thibault

[Updated on: Tue, 30 May 2017 13:41]

Report message to a moderator

Previous Topic:Flaky web access to git repository
Next Topic:egit Broken after upgrade
Goto Forum:
  


Current Time: Wed Sep 26 06:24:19 GMT 2018

Powered by FUDForum. Page generated in 0.03172 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top