
    .Phj
                     v    d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlZdZ G d d	eee          ZdS )
    )
CompoundDB	ObjectDBW
FileDBBase)LooseObjectDB)PackedDB)ReferenceDB)InvalidDBRootN)GitDBc                        e Zd ZdZeZeZeZ	dZ
dZej                            dd          Z fdZ fdZd Zd	 Zd
 Z xZS )r
   a  A git-style object database, which contains all objects in the 'objects'
    subdirectory

    ``IMPORTANT``: The usage of this implementation is highly discouraged as it fails to release file-handles.
    This can be a problem with long-running processes and/or big repositories.
    pack info
alternatesc                 J    t                                          |           dS )z/Initialize ourselves on a git objects directoryN)super__init__)self	root_path	__class__s     L/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/gitdb/db/git.pyr   zGitDB.__init__(   s!    #####    c                 ^   |dk    s|dk    rt                      | _        d }| j        | j        f| j        | j        f| j        | j        ffD ]r\  }}|                     |          }t          j
                            |          r9| j                             ||                     || j        u r| j        d         }s| j        s!t          |                                           |t          |d          s
J d            || _        d S t#                                          |           d S )N_dbs	_loose_dbstorez(First database needs store functionality)listr   	packs_dir	PackDBCls	loose_dir
LooseDBClsalternates_dirReferenceDBClsdb_pathospathexistsappendr	   r   hasattrr   r   _set_cache_)r   attrloose_dbsubpathdbclsr&   r   s         r   r*   zGitDB._set_cache_,   s7   6>>T[00DIH$(NDN#C$(NDO#D$($79L#M#O 1 1 ||G,,7>>$'' 1I$$UU4[[111//#'9R= 9 6#DNN$4$4555 'GHg,F,F''Hr''' &DNNNGG%%%%%r   c                 6    | j                             |          S N)r   r   )r   istreams     r   r   zGitDB.storeL   s    ~##G,,,r   c                 4    | j                                         S r0   )r   ostream)r   s    r   r3   zGitDB.ostreamO   s    ~%%'''r   c                 6    | j                             |          S r0   )r   set_ostream)r   r3   s     r   r5   zGitDB.set_ostreamR   s    ~))'222r   )__name__
__module____qualname____doc__r   r   r   r!   r   r#   r   r    r%   r&   joinr"   r   r*   r   r3   r5   __classcell__)r   s   @r   r
   r
      s          IJ N IIW\\&,77N$ $ $ $ $& & & & &@- - -( ( (3 3 3 3 3 3 3r   r
   )gitdb.db.baser   r   r   gitdb.db.looser   gitdb.db.packr   gitdb.db.refr   	gitdb.excr	   r%   __all__r
    r   r   <module>rC      s   
          ) ( ( ( ( ( " " " " " " $ $ $ $ $ $ # # # # # # 				
=3 =3 =3 =3 =3J	: =3 =3 =3 =3 =3r   