Skip to content

Commit c4ef2f4

Browse files
committed
Fix getting the commit underneath a reference
Signed-off-by: Pierre-Yves Chibon <[email protected]>
1 parent 23c2be7 commit c4ef2f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitsync.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import watchdog.events
3333
from watchdog.observers import Observer
3434

35-
from pygit2 import Repository, Signature
35+
from pygit2 import Repository, Signature, Commit
3636
from pygit2 import (GIT_STATUS_WT_NEW, GIT_STATUS_WT_DELETED,
3737
GIT_STATUS_WT_MODIFIED)
3838

@@ -138,7 +138,7 @@ def run_push(repo_path):
138138
def docommit(repo, index, msg):
139139
index.write()
140140
tree = index.write_tree()
141-
head = repo.lookup_reference('HEAD').get_object()
141+
head = repo.lookup_reference('HEAD').peel(Commit)
142142
commit = repo[head.oid]
143143
committer = Signature(
144144
'gitsync',

0 commit comments

Comments
 (0)