← Back to team overview

dulwich-users team mailing list archive

Re: Specifying a file's path?

 



On 07/20/2013 09:16 PM, milki wrote:
On 20:42 Sat 20 Jul     , Adam Seering wrote:
Hi all,
	I'm trying to programmatically commit files to a bare repo.

	The online documentation has a very nice example of how to add a
file as a Blob, and how to specify its filename.

	But it doesn't indicate how to specify the file's path.

You need to create the corresponding Tree structure that you will be
adding to your Commit.

If you examine an existing Tree that has multiple subdirectories,
(either with Dulwich or git ls-tree <treeish>, you will find that each
subdirectory is yet another Tree. So, to create the path, each
subdirectory will be another Tree and your Blob will belong in the final
Tree.


Thanks!  I'll give this a try.

Adam



References