Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/vcpkg/vcpkgpaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,11 @@ If you wish to silence this error and use classic mode, you can:
std::error_code ec;
Files::ExclusiveFileLock guard(Files::ExclusiveFileLock::Wait::Yes, fs, lock_file, ec);

System::Command fetch_git_ref =
git_cmd_builder(*this, dot_git_dir, work_tree).string_arg("fetch").string_arg("--").string_arg(repo);
System::Command fetch_git_ref = git_cmd_builder(*this, dot_git_dir, work_tree)
.string_arg("fetch")
.string_arg("--update-shallow")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.string_arg("--update-shallow")
.string_arg("--unshallow")

Since git repos reference tree objects in the history, we need the full history available.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is: For a shallow clone such as VCPK_INSTALLATION_ROOT in Azure Pipelines, one would need to unshallow the clone at VCPKG_INSTALLATION_ROOT. You cannot apply --unshallow when fetching from the shallow clone.

Since git repos reference tree objects in the history, we need the full history available.

I'm not a git tree object expert. Anyway, do you really always need the full history, or just enough depth to resolve the references for the desired ports and versions?

.string_arg("--")
.string_arg(repo);
if (treeish.size() != 0)
{
fetch_git_ref.string_arg(treeish);
Expand Down