Skip to content

Commit 7a82e43

Browse files
authored
handle_repo_add: unshallow repo when adding via commit hash (#4542)
1 parent 52d7fa3 commit 7a82e43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,8 +1036,8 @@ function handle_repo_add!(ctx::Context, pkg::PackageSpec)
10361036
specific_refspec = ["+refs/heads/$(rev_or_hash):refs/cache/heads/$(rev_or_hash)"]
10371037
GitTools.fetch(ctx.io, repo, repo_source_typed; refspecs = specific_refspec, depth = 1)
10381038
else
1039-
# For commit hashes, fetch all branches
1040-
GitTools.fetch(ctx.io, repo, repo_source_typed; refspecs = refspecs)
1039+
# For commit hashes, fetch all branches including the older commits
1040+
GitTools.fetch(ctx.io, repo, repo_source_typed; refspecs = refspecs, depth = LibGit2.Consts.FETCH_DEPTH_UNSHALLOW)
10411041
end
10421042
obj_branch = get_object_or_branch(repo, rev_or_hash)
10431043
# If still not found, try with broader refspec as fallback

0 commit comments

Comments
 (0)