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 /shallow.c | |
parent | 016e6ccbe03438454777e43dd73d67844296a3fd (diff) | |
download | git-f53514bc2d82f2f5cc7b447575e74aa266ed46f0.tar.gz |
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 'shallow.c')
-rw-r--r-- | shallow.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -41,7 +41,8 @@ int is_repository_shallow() return is_shallow; } -struct commit_list *get_shallow_commits(struct object_array *heads, int depth) +struct commit_list *get_shallow_commits(struct object_array *heads, int depth, + int shallow_flag, int not_shallow_flag) { int i = 0, cur_depth = 0; struct commit_list *result = NULL; @@ -67,6 +68,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth) } } parse_commit(commit); + commit->object.flags |= not_shallow_flag; cur_depth++; for (p = commit->parents, commit = NULL; p; p = p->next) { if (!p->item->util) { @@ -87,8 +89,10 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth) commit = p->item; cur_depth = *(int *)commit->util; } - } else + } else { commit_list_insert(p->item, &result); + p->item->object.flags |= shallow_flag; + } } } |