Create CPM_EnsureRepoIsCurrent function for utility purposes.