yL i  gdZddlmZddlZddlZddlmZddlmZddl m Z m Z m Z m Z ddlmZe r ddlmZdd lmZmZdd lmZdd lmZd d lmZdedefdZdedefdZdddeddfdZde ddeddfdZGddeZy)) sm_sectionsm_namemkheadfind_first_remote_branchSubmoduleConfigParser)BytesION)GitConfigParser)InvalidGitRepositoryError)AnySequence TYPE_CHECKINGUnion)PathLike) ReferenceType)HeadRemoteReference)Remote)Repo) Submodulenamereturncd|dS)zA:return: Section title used in ``.gitmodules`` configuration filez submodule "")rs `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/objects/submodule/util.pyrr%s a  sectionc,|j}|ddS)z>:return: Name of the submodule as parsed from the section name )strip)rs rrr*smmoG 2b>rreporpathrchtj|tjj|S)z!:return: New branch/head instance)gitr to_full_path)r#r$s rrr0s" 88D#((//5 66rremotesr branch_namercl|D]} |j|cStd|z#t$rY/wxYw)ztFind the remote branch matching the name of the given branch or raise :exc:`~git.exc.InvalidGitRepositoryError`.z:Didn't find remote branch '%r' in any of the given remotes)refs IndexErrorr )r(r)remotes rrr5sO ;;{+ + $$`cn$n oo    s ' 33cLeZdZdZdededdffd Zd dZd dZd fd ZxZ S) raCatches calls to :meth:`~git.config.GitConfigParser.write`, and updates the ``.gitmodules`` blob in the index with the new data, if we have written into a stream. Otherwise it would add the local file to the index to make it correspond with the working tree. Additionally, the cache must be cleared. Please note that no mutating method will work in bare mode. argskwargsrNcNd|_d|_d|_t||i|y)NT)_smref_index _auto_writesuper__init__)selfr/r0 __class__s rr6zSubmoduleConfigParser.__init__Rs+?C   $)&)rc8tj||_y)zaSet this instance's submodule. It must be called before the first write operation begins.N)weakrefrefr2)r7 submodules r set_submodulez#SubmoduleConfigParser.set_submoduleYskk), rc6|jJt|jtrJ|j}|]|j}||j j }|j|jg|j|jyy)z5Flush changes in our configuration file to the index.N)write) r2 isinstance_file_or_filesrr3r#indexaddk_modules_filer4 _clear_cache)r7smrBs rflush_to_indexz$SubmoduleConfigParser.flush_to_index^s{{&&&d117;;; [[] >KKE}  IIr(()1A1AI B OO  rcDt|}|j|S)N)r5r?rG)r7rvalr8s rr?zSubmoduleConfigParser.writeqsW]_  r)r<rrN)rN) __name__ __module__ __qualname____doc__r r6r=rGr? __classcell__)r8s@rrrGs6*c*S*T*- &rr) __all__iorr:r& git.configr git.excr typingr r r r git.typesrrgit.refsrr git.remotergit.reporbaserstrrrrrrrrrrZs  &-76%.! !S!S! SS 77x7F7 phx&8 ps pO` p$-O-r