allow deepening of a shallow repository

Now, by saying "git fetch -depth <n> <repo>" you can deepen
a shallow repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Johannes Schindelin
2006-10-30 20:09:53 +01:00
committed by Junio C Hamano
parent 016e6ccbe0
commit f53514bc2d
6 changed files with 97 additions and 21 deletions

View File

@ -255,6 +255,19 @@ int write_shallow_commits(int fd, int use_pack_protocol)
return count;
}
int unregister_shallow(const unsigned char *sha1)
{
int pos = commit_graft_pos(sha1);
if (pos < 0)
return -1;
if (pos + 1 < commit_graft_nr)
memcpy(commit_graft + pos, commit_graft + pos + 1,
sizeof(struct commit_graft *)
* (commit_graft_nr - pos - 1));
commit_graft_nr--;
return 0;
}
int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
{
char *tail = buffer;