Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid fetching all tags on git clone/fetch #1089

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion src/source/git_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ pub fn fetch_repo(
// This should be safe, as we do a `git checkout` below to refresh
// the working copy.
"--update-head-ok",
// Avoid overhead of fetching unused tags.
"--no-tags",
url,
refspec.as_str(),
])
Expand Down Expand Up @@ -195,7 +197,13 @@ pub fn git_src(
if !cache_path.exists() {
let mut command = git_command(system_tools, "clone")?;
command
.args(["--progress", "-n", source.url().to_string().as_str()])
.args([
// Avoid overhead of fetching unused tags.
"--no-tags",
"--progress",
"-n",
source.url().to_string().as_str(),
])
.arg(cache_path.as_os_str());

let output = command
Expand Down
2 changes: 1 addition & 1 deletion test-data/recipes/git_source_patch/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package:

source:
git: https://github.com/ros2-gbp/ament_package-release.git
rev: release/humble/ament_package/0.14.0-4
tag: release/humble/ament_package/0.14.0-4
target_directory: ros-humble-ament-package/src/work
patches:
- patch/ros-humble-ament-package.patch
2 changes: 1 addition & 1 deletion test-data/recipes/llamacpp/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package:

source:
git: https://github.com/ggerganov/llama.cpp.git
rev: "${{ version }}"
tag: "${{ version }}"

build:
number: 0
Expand Down
2 changes: 1 addition & 1 deletion test-data/recipes/package-content-tests/llama-recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package:

source:
git: https://github.com/ggerganov/llama.cpp.git
rev: "${{ version }}"
tag: "${{ version }}"

build:
number: 0
Expand Down
2 changes: 1 addition & 1 deletion test-data/recipes/variants/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package:

source:
git: https://github.com/ggerganov/llama.cpp.git
rev: "${{ version }}"
tag: "${{ version }}"

build:
variant:
Expand Down
Loading