path: implement common_dir handling in git_pathdup_submodule()