Skip to content

Commit a8ee94b

Browse files
committed
Add type to symbolicreference._create()
1 parent f657efc commit a8ee94b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎git/refs/symbolic.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ def delete(cls, repo, path):
493493
# END remove reflog
494494

495495
@classmethod
496-
def _create(cls, repo, path, resolve, reference, force, logmsg=None):
496+
def _create(cls: Type[T_References], repo: 'Repo', path: PathLike, resolve: bool,
497+
reference: Union['SymbolicReference', str], force: bool,
498+
logmsg: Union[str, None] = None) -> T_References:
497499
"""internal method used to create a new symbolic reference.
498500
If resolve is False, the reference will be taken as is, creating
499501
a proper symbolic reference. Otherwise it will be resolved to the
@@ -511,7 +513,7 @@ def _create(cls, repo, path, resolve, reference, force, logmsg=None):
511513
if not force and os.path.isfile(abs_ref_path):
512514
target_data = str(target)
513515
if isinstance(target, SymbolicReference):
514-
target_data = target.path
516+
target_data = str(target.path)
515517
if not resolve:
516518
target_data = "ref: " + target_data
517519
with open(abs_ref_path, 'rb') as fd:

0 commit comments

Comments
 (0)