Repository navigation
docs: correct docstrings that describe a removed ref cache and wrong validation examples - #4374
Merged
Merged
Conversation
…validation examples
validate_template's examples ({{ args }} in a hook, {{ target }} in a
pre-start hook) both validate; replace them with mismatches the scope
check does reject. Comments citing the ambient ref→SHA cache describe a
cache #2528 removed. The patch-id squash check documents its error path
as Ok(false); errors propagate and the caller maps them to no match.
Collaborator
Author
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Comment-only change: four docstrings in
src/gitandsrc/configdescribe behavior the code no longer has. No code changes, so there's no regression test.validate_templateexamples were backwards. It claimed validation catches{{ args }}in a hook and{{ target }}in apre-starthook. Both validate:vars_available_in(Hook(_))addsargs, and thePreCreateextras includetarget. The new examples,{{ base }}inpre-mergeand{{ args }}in--execute, are mismatches thattest_validate_template_scope_rejects_out_of_scope_varsand theSwitchExecutecase already assert are rejected. TheValidationScope::Hookdoc now listsargstoo.RepoCache::commit_shas, but comments onis_ancestor_by_sha,has_added_changes_by_sha,merge_base_by_sha,branch_diff_stats_by_sha,compute_integration_lazy, and thewt listsnapshot fields still describe the_by_shaforms as bypassing it. They now say what those forms do: skip ref resolution and read the snapshot's point-in-time state.is_squash_merged_via_patch_id. The docstring said it returnsOk(false)when patch-id computation fails. In fact git errors propagate through?, and the only caller turns them into "no match" with.unwrap_or(false).