From f53514bc2d82f2f5cc7b447575e74aa266ed46f0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 30 Oct 2006 20:09:53 +0100 Subject: allow deepening of a shallow repository Now, by saying "git fetch -depth " you can deepen a shallow repository. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- shallow.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'shallow.c') diff --git a/shallow.c b/shallow.c index 3cf2127134..58a7b20d79 100644 --- a/shallow.c +++ b/shallow.c @@ -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; + } } } -- cgit v1.2.3