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

	rootedProviders.sort(createProviderComparer(uri));

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

	if (result) {
		return result;
	}

	const nonRootedProviders = providers.filter(p => !p.rootUri);
	return first(nonRootedProviders.map(p => () => p.getOriginalResource(uri)));
}