Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ecb794

Browse files
authored
Update symbolic.py
1 parentebe53dd commit3ecb794

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎git/refs/symbolic.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def set_object(self, object, logmsg=None): # @ReservedAssignment
274274
# set the commit on our reference
275275
returnself._get_reference().set_object(object,logmsg)
276276

277-
commit=property(_get_commit,set_commit,doc="Query or set commits directly")
277+
commit:'Commit'=property(_get_commit,set_commit,doc="Query or set commits directly")# type: ignore
278278
object=property(_get_object,set_object,doc="Return the object our ref currently refers to")
279279

280280
def_get_reference(self):
@@ -286,7 +286,8 @@ def _get_reference(self):
286286
raiseTypeError("%s is a detached symbolic reference as it points to %r"% (self,sha))
287287
returnself.from_path(self.repo,target_ref_path)
288288

289-
defset_reference(self,ref,logmsg=None):
289+
defset_reference(self,ref:Union['SymbolicReference',Commit_ish,str],
290+
logmsg:Union[str,None]=None)->'SymbolicReference':
290291
"""Set ourselves to the given ref. It will stay a symbol if the ref is a Reference.
291292
Otherwise an Object, given as Object instance or refspec, is assumed and if valid,
292293
will be set which effectively detaches the refererence if it was a purely
@@ -327,7 +328,7 @@ def set_reference(self, ref, logmsg=None):
327328
raiseTypeError("Require commit, got %r"%obj)
328329
# END verify type
329330

330-
oldbinsha=None
331+
oldbinsha=b''
331332
iflogmsgisnotNone:
332333
try:
333334
oldbinsha=self.commit.binsha
@@ -356,8 +357,8 @@ def set_reference(self, ref, logmsg=None):
356357
returnself
357358

358359
# aliased reference
359-
reference=property(_get_reference,set_reference,doc="Returns the Reference we point to")
360-
ref:Union[Commit_ish]=reference# type: ignore # Union[str, Commit_ish, SymbolicReference]
360+
reference=property(_get_reference,set_reference,doc="Returns the Reference we point to")# type: ignore
361+
ref:Union['Reference','Head']=reference# type: ignore
361362

362363
defis_valid(self):
363364
"""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp