def _fs_to_tree_path(fs_path, fs_encoding=None):
 if (fs_encoding is None):
  fs_encoding = sys.getfilesystemencoding()
 if (not isinstance(fs_path, bytes)):
  fs_path_bytes = fs_path.encode(fs_encoding)
 else:
  fs_path_bytes = fs_path
 if (os_sep_bytes != '/'):
  tree_path = fs_path_bytes.replace(os_sep_bytes, '/')
 else:
  tree_path = fs_path_bytes
 return tree_path

def _fs_to_tree_path ( fs_path , fs_encoding = None ) : if ( fs_encoding is None ) : fs_encoding = sys . getfilesystemencoding ( ) if ( not isinstance ( fs_path , bytes ) ) : fs_path_bytes = fs_path . encode ( fs_encoding ) else : fs_path_bytes = fs_path if ( os_sep_bytes != '/' ) : tree_path = fs_path_bytes . replace ( os_sep_bytes , '/' ) else : tree_path = fs_path_bytes return tree_path
convert a file system path to a git tree path .