MergerInterface
Interface
Defines the contract for merging .gitignore entries.
Description
This service SHALL combine canonical and project-specific .gitignore definitions into an ordered result. Canonical defaults MUST precede consumer rules. The merger MUST preserve pattern whitespace and repeated rules because Git resolves conflicts using the last matching pattern.
Methods
merge()
: GitIgnoreInterface
Merges two GitIgnore instances without changing consumer rule precedence.
Methods
Merges two GitIgnore instances without changing consumer rule precedence.
public
merge(GitIgnoreInterface
$canonical, GitIgnoreInterface
$project) : GitIgnoreInterface
Description
An already present canonical prefix MUST NOT be added again. The path from $project is used in the returned instance.
Parameters
Description
the canonical .gitignore from dev-tools
Description
the project-specific .gitignore
Return values
Description
a new GitIgnore instance with merged entries