-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitpure.pyi
More file actions
109 lines (83 loc) · 2.63 KB
/
Copy pathgitpure.pyi
File metadata and controls
109 lines (83 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""
Type stubs for gitpure - A pure git Python module implemented in Rust.
"""
from pathlib import Path
from typing import Type
class Commit:
"""Lightweight representation of a git commit."""
@property
def hexsha(self) -> str:
"""Hexadecimal object id of the commit."""
...
class Head:
"""A named reference to a commit, mirroring GitPython's Head."""
@property
def name(self) -> str:
"""The short name of the head (branch)."""
...
@property
def commit(self) -> Commit | None:
"""The commit the head points to, if available."""
...
class Tag:
"""A tag reference with optional peeled commit."""
@property
def name(self) -> str:
"""The short name of the tag."""
...
@property
def commit(self) -> Commit | None:
"""The commit the tag ultimately refers to, if available."""
...
class Repo:
"""A git repository wrapper using gix (gitoxide)."""
@property
def git_dir(self) -> Path:
"""
Path to the .git directory of the repository.
Returns:
The absolute path to the .git directory as a pathlib.Path object
"""
...
@property
def branches(self) -> list[Head]:
"""Return all local branches as Head objects."""
...
@property
def working_tree_dir(self) -> Path | None:
"""Return the working tree directory of the repository, if it exists."""
...
@property
def is_bare(self) -> bool:
"""Whether the repository is bare (has no working tree)."""
...
@property
def active_branch(self) -> Head | None:
"""Current active branch as a Head object, if available."""
...
@property
def head(self) -> Head | None:
"""HEAD reference as a Head object, if available."""
...
@property
def heads(self) -> list[Head]:
"""Return all local heads (branches) in the repository."""
...
@property
def tags(self) -> list[Tag]:
"""Return all tags in the repository."""
...
@classmethod
def clone_from(cls: Type["Repo"], url: str, to_path: str, bare: bool = False) -> "Repo":
"""
Clone a repository from a URL to a local path.
Args:
url: The URL of the repository to clone
to_path: The local path where the repository should be cloned
bare: Whether to create a bare repository (default: False)
Returns:
A new Repo instance representing the cloned repository
Raises:
RuntimeError: If the clone operation fails
"""
...