|Constructing in-memory push with jgit [message #715615]
||Sun, 14 August 2011 20:52
| Pawel Kozlowski
Registered: August 2011
First of all thnx for all the hard work put into jgit. It is amazing to see full-JAva impl of Git - it opens up so many posibilities...
Now, speaking of possibilities... I'm working on a project where we are thinking of using git to allow our users to upload some customization data. Normal git repo hosting, nothing fancy here. But, on top of the hosting we would like to give users a possibility to edit some content through on-line editors: this way users would have 2 ways of managing content - either through normal git clone/push or through on-line editors.
Now, I would like to use jgit to plug an online editor into git repo (each user would have a bare git repo where it could upload content). The erditor need to support basic CRUD operations - while loading blobs is easy I wonder if I can push content directly to a bare repo. I've managed to get save / update working with jgit by doing this "magic":
- clone user's repo into a temp dir
- add content / commit (AddCommand / CommitCommand)
- push (PushCommand)
- delete dir
The above kind of works but I've noticed that my junits are failing from time to time - I guess this is cause of messing up with a temp folder.
I would like to kindly ask if the above is possible? Basically I would like to create an im-memory commit and push it into a repo. From what I can see the Transport class operates on a file system so no luck here.
Would be grateful for any directions, curretly I'm looking into CommitBuilder class but then I would need to construct a new tree etc. Is there an easier way? Or maybe I'm approaching it from a terribly wrong angle?
Powered by FUDForum
. Page generated in 0.02785 seconds