+G[ d dl mZmZ d dlmZ d dlmZ ddlmZ ddl m Z d dlmZm Z mZmZ d dlmZmZ erd d lmZ d d lmZ d dlmZ dd gZdedefdZ G d de Z G d d e ZdS ) )GitConfigParserSectionConstraint) join_path)GitCommandError )SymbolicReference) Reference)AnySequenceUnion TYPE_CHECKING)PathLike Commit_ish)Repo)CommitRemoteReferenceHEADHeadstringreturnc n | d r| d r | dd S | S )N"r ) startswithendswith)r s _/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/git/refs/head.pystrip_quotesr s> &//#"6"6 ad|M c e Zd ZdZd ZdZdZefdddef fd Zde fd Z dd eee e f dededeeee df dedd fdZ xZS )r zZSpecial case of a Symbolic Reference as it represents the repository's HEAD reference. ORIG_HEAD repor pathc || j k rt d| j d| t t | || | d S )NzHEAD instance must point to z, got ) _HEAD_NAME ValueErrorsuperr __init__)selfr# r$ __class__s r r) z HEAD.__init__' s[ 4?""*Z^Z^_``` dD""4...r r c 6 t | j | j S )z :return: SymbolicReference pointing at the ORIG_HEAD, which is maintained to contain the previous value of HEAD)r r# _ORIG_HEAD_NAMEr* s r orig_headzHEAD.orig_head- s !D,@AAAr TFNcommitindexworking_treepathskwargsc d}|rd}|rd}|rd}|st d | j j j ||d|fi | n## t $ r}|j dk r Y d}~nd}~ww xY w| S )a Reset our HEAD to the given commit optionally synchronizing the index and working tree. The reference we refer to will be set to commit as well. :param commit: Commit object, Reference Object or string identifying a revision we should reset HEAD to. :param index: If True, the index will be set to match the given commit. Otherwise it will not be touched. :param working_tree: If True, the working tree will be forcefully adjusted to match the given commit, possibly overwriting uncommitted changes without warning. If working_tree is True, index must be true as well :param paths: Single path or list of paths relative to the git root directory that are to be reset. This allows to partially reset individual files. :param kwargs: Additional arguments passed to git-reset. :return: selfz--softz--mixedNz--hardz?Cannot reset the working tree if the index is not reset as wellz--r )r' r# gitresetr status)r* r0 r1 r2 r3 r4 modees r r7 z HEAD.reset3 s D D dD d !bccc DIMfdEDDVDDDD x1}} }}}} s = AAA)r TFN)__name__ __module____qualname____doc__r&