Re: [PATCH 2/7] sha1_file, link: write link objects to the database

2013-04-05 Thread Ramkumar Ramachandra
Ramkumar Ramachandra wrote: diff --git a/link.c b/link.c index bb20a51..349646d 100644 --- a/link.c +++ b/link.c @@ -20,8 +20,30 @@ struct link *lookup_link(const unsigned char *sha1) int parse_link_buffer(struct link *item, void *buffer, unsigned long size) { + char *bufptr =

Re: [PATCH 2/7] sha1_file, link: write link objects to the database

2013-04-05 Thread Ramkumar Ramachandra
Ramkumar Ramachandra wrote: This needs to be replaced by a .git/config parser. However, I can't use the parser from config.c as-it-is, because it expects a section like [core] to be present. So, we have to refactor it to optionally parse section-less configs. Er, sorry about the thinko: I

[PATCH 2/7] sha1_file, link: write link objects to the database

2013-04-04 Thread Ramkumar Ramachandra
On a 'git add', instead of returning the SHA-1 of the subproject commit, write a real link object to the object database. Also implement parse_link_buffer() correspondingly. index_path() determines the upstream_url and checkout_rev from a pre-cloned submodule. The checkout_rev is set to the