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:

committed by
Junio C Hamano

parent
016e6ccbe0
commit
f53514bc2d
13
commit.c
13
commit.c
@ -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;
|
||||
|
Reference in New Issue
Block a user