summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-01 20:39:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-01 20:39:51 (GMT)
commit2b4ff3d3dc64d4abcded7caa9bcdf063aea5ec3f (patch)
treed92a6b80a57a024256b1306665e629ae1d4b8185 /fetch-pack.c
parentcc0c732f6ba533ed4ee9f8a29f30628b04dba373 (diff)
parent37b9dcabfc48b0cbce638140279878dac37aec73 (diff)
downloadgit-2b4ff3d3dc64d4abcded7caa9bcdf063aea5ec3f.zip
git-2b4ff3d3dc64d4abcded7caa9bcdf063aea5ec3f.tar.gz
git-2b4ff3d3dc64d4abcded7caa9bcdf063aea5ec3f.tar.bz2
Merge branch 'tb/reset-shallow'
Fix in-core inconsistency after fetching into a shallow repository that broke the code to write out commit-graph. * tb/reset-shallow: shallow.c: use '{commit,rollback}_shallow_file' t5537: use test_write_lines and indented heredocs for readability
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 0b07b3e..8e98b3d 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -1629,9 +1629,9 @@ static void update_shallow(struct fetch_pack_args *args,
if (args->deepen && alternate_shallow_file) {
if (*alternate_shallow_file == '\0') { /* --unshallow */
unlink_or_warn(git_path_shallow(the_repository));
- rollback_lock_file(&shallow_lock);
+ rollback_shallow_file(the_repository, &shallow_lock);
} else
- commit_lock_file(&shallow_lock);
+ commit_shallow_file(the_repository, &shallow_lock);
alternate_shallow_file = NULL;
return;
}
@@ -1655,7 +1655,7 @@ static void update_shallow(struct fetch_pack_args *args,
setup_alternate_shallow(&shallow_lock,
&alternate_shallow_file,
&extra);
- commit_lock_file(&shallow_lock);
+ commit_shallow_file(the_repository, &shallow_lock);
alternate_shallow_file = NULL;
}
oid_array_clear(&extra);
@@ -1693,7 +1693,7 @@ static void update_shallow(struct fetch_pack_args *args,
setup_alternate_shallow(&shallow_lock,
&alternate_shallow_file,
&extra);
- commit_lock_file(&shallow_lock);
+ commit_shallow_file(the_repository, &shallow_lock);
oid_array_clear(&extra);
oid_array_clear(&ref);
alternate_shallow_file = NULL;
@@ -1785,7 +1785,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
error(_("remote did not send all necessary objects"));
free_refs(ref_cpy);
ref_cpy = NULL;
- rollback_lock_file(&shallow_lock);
+ rollback_shallow_file(the_repository, &shallow_lock);
goto cleanup;
}
args->connectivity_checked = 1;