combine-diff: move changed-paths scanning logic into its own function