src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts/getOriginalResource
export async function getOriginalResource(scmService: ISCMService, uri: URI): Promise<URI | null> {
	const providers = Iterable.map(scmService.repositories, r => r.provider);
	const rootedProviders = Array.from(Iterable.filter(providers, p => !!p.rootUri));

	rootedProviders.sort(createProviderComparer(uri));

	const result = await first(rootedProviders.map(p => () => p.getOriginalResource(uri)));

	if (result) {
		return result;
	}

	const nonRootedProviders = Iterable.filter(providers, p => !p.rootUri);
	return first(Array.from(nonRootedProviders, p => () => p.getOriginalResource(uri)));
}