File: //opt/saltstack/salt/lib/python3.10/site-packages/git/index/__pycache__/base.cpython-310.pyc
o
;j1� � @ s d Z g d�ZddlZddlZddlZddlmZ ddlZddlm Z
ddlmZ ddl
Z
ddlZddlZddlmZ ddlmZ ddlmZmZ ddlmZ dd lmZmZmZmZ dd
lm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ d
dl0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8 d
dl9m:Z:m;Z;m<Z< d
dl=m>Z>m?Z?m@Z@mAZA ddlBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZP ddlQmRZRmSZS eNr�ddl
mTZT ddlUmVZV ddlWmXZX ePe$e!eYeZf Z[ej\deSdeGeYddf fdd��Z]G dd� de)ej^e&�Z_dS )z�Module containing :class:`IndexFile`, an Index implementation facilitating all kinds
of index manipulations such as querying and merging.)� IndexFile�
CheckoutError� StageType� N)�BytesIO)�S_ISLNK)�IStream)�MemoryDB)�defenc�force_bytes)r �GitCommandError�GitError�InvalidGitRepositoryError)�Blob�Commit�Object� Submodule�Tree)�Serializable)�Actor� LazyMixin�LockedFD�join_path_native�file_contents_ro�to_native_path_linux�unbare_repo�
to_bin_sha� )�S_IFGITLINK�aggressive_tree_merge� entry_key�
read_cache�run_commit_hook�stat_mode_to_index_mode�write_cache�write_tree_from_cache)�BaseIndexEntry�
IndexEntryr )�TemporaryFileSwap�post_clear_cache�
default_index�git_working_dir)�Any�BinaryIO�Callable�Dict� Generator�IO�Iterable�Iterator�List�NoReturn�Sequence�
TYPE_CHECKING�Tuple�Union)�Literal�PathLike)�Popen)� Reference)�Repo� directory�returnc c s� � t jdkr%tj| d�\}}t�|� z|V W t�|� dS t�|� w tj| d��
}|jV W d � dS 1 s;w Y dS )a$ Create a named temporary file git subprocesses can open, deleting it afterward.
:param directory:
The directory in which the file is created.
:return:
A context manager object that creates the file and provides its name on entry,
and deletes it on exit.
�win32)�dirN) �sys�platform�tempfileZmkstemp�os�close�removeZNamedTemporaryFile�name)r>