sync-versions: exclude git-fetched upstream sources from Cat 1 sync
Cat 1 discovery treated every local/recipes/*\/source/Cargo.toml as an in-house crate, including git-fetched upstream sources like brush (git = github.com/reubeno/brush). Rewriting upstream crate versions to the branch version broke upstream-internal version requirements (brush-shell was forced to 0.3.1 while brush required ^0.4.0 — 'failed to select a version for the requirement brush-shell = ^0.4.0'). Guard: skip any crate whose Cargo.toml is not tracked by the parent repo. In-house crates are tracked trees (no independent .git); fetched sources are gitignored and untracked. Restores correct classification: 75 crates checked (12 fetched-source crates now excluded), drift 0, brush cooks successfully again.
This commit is contained in:
@@ -104,6 +104,16 @@ should_exclude() {
|
||||
[[ "$path" == *"$ex"* ]] && return 0
|
||||
done
|
||||
|
||||
# Skip git-fetched upstream sources. Fetched recipe sources (e.g. brush
|
||||
# from github) live in gitignored, untracked source/ trees; their crate
|
||||
# versions belong to upstream, not to the Cat 1 in-house branch-version
|
||||
# policy. Rewriting them breaks upstream-internal version requirements
|
||||
# (this happened: brush-shell was forced to 0.3.1 while brush required
|
||||
# ^0.4.0, breaking the build). In-house crates are tracked trees.
|
||||
if ! git ls-files --error-unmatch "$path" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user