summaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-10-30 20:09:53 +0100
committerJunio C Hamano <junkio@cox.net>2006-11-24 15:42:49 -0800
commitf53514bc2d82f2f5cc7b447575e74aa266ed46f0 (patch)
tree66550c439e27a793cce8d1cee474620d54e81bc1 /shallow.c
parent016e6ccbe03438454777e43dd73d67844296a3fd (diff)
downloadgit-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.c8
1 files changed, 6 insertions, 2 deletions
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;
+ }
}
}