Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-02 00:39:24 +0400
committerJunio C Hamano <gitster@pobox.com>2013-02-02 00:39:24 +0400
commit2532d891a4aab003a5ce19f04509fd8549754485 (patch)
treedd423e056e45994a8af8ee7c9e174209ece868f2 /shallow.c
parent9a6c84e6e9078b0ef4fd2c50b200e8552a28c6fa (diff)
parentcfb70e1fa506e79f337e716ed4813c6caa428644 (diff)
Merge branch 'nd/fetch-depth-is-broken'
"git fetch --depth" was broken in at least three ways. The resulting history was deeper than specified by one commit, it was unclear how to wipe the shallowness of the repository with the command, and documentation was misleading. * nd/fetch-depth-is-broken: fetch: elaborate --depth action upload-pack: fix off-by-one depth calculation in shallow clone fetch: add --unshallow for turning shallow repo into complete one
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/shallow.c b/shallow.c
index a0363dea20..6be915f38f 100644
--- a/shallow.c
+++ b/shallow.c
@@ -72,8 +72,14 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
}
if (parse_commit(commit))
die("invalid commit");
- commit->object.flags |= not_shallow_flag;
cur_depth++;
+ if (cur_depth >= depth) {
+ commit_list_insert(commit, &result);
+ commit->object.flags |= shallow_flag;
+ commit = NULL;
+ continue;
+ }
+ commit->object.flags |= not_shallow_flag;
for (p = commit->parents, commit = NULL; p; p = p->next) {
if (!p->item->util) {
int *pointer = xmalloc(sizeof(int));