diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2006-10-30 20:09:53 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-11-24 15:42:49 -0800 |
commit | f53514bc2d82f2f5cc7b447575e74aa266ed46f0 (patch) | |
tree | 66550c439e27a793cce8d1cee474620d54e81bc1 /commit.c | |
parent | 016e6ccbe03438454777e43dd73d67844296a3fd (diff) | |
download | git-f53514bc2d82f2f5cc7b447575e74aa266ed46f0.tar.gz git-f53514bc2d82f2f5cc7b447575e74aa266ed46f0.tar.xz |
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>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; |