java - Creating commit with Jgit and plumbing commands -


i trying construct commit plumbing commands in jgit. besides fetching information, use these commands:

treeformatter.append(foldername, filemode.tree, treeobjectid); treeformatter.append(filename, filemode.regular_file, blobobjectid); 

eventually

objectinserter.insert( treeformatter ); 

and @ end setting final tree commit. works commits others although files there can't push repo. bash says:

error: unpack failed: error invalid tree (tree number): incorrectly sorted

i found out here

tree entries sorted byte sequence comprises entry name. however, purposes of sort comparison, entries tree objects compared if entry name byte sequence has trailing ascii ‘/’ (0x2f).

so tried add files particular order based in conversion bytes of object name (not file name), comparing actual commits bash, can't figure out order git need add files.

so: knows how use plumbing methods in jgit construct commit several files? pretty sure need correct way of sorting objects can't find out it

just found out solution,

you need put files in particular order depending on file name or folder name, problem looking objectid.getname() hash.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -