initial commit
This commit is contained in:
12
test.py
Normal file
12
test.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from gitapi import *
|
||||
|
||||
repo = Git.init(r"C:\Users\Kuba\AppData\Local\Temp\git\new")
|
||||
blob_hash = repo.create_blob(b"testcontent")
|
||||
tree = [GitFile(33188, "testfile", blob_hash)]
|
||||
tree_hash = repo.create_tree(tree)
|
||||
user = GitUser("Hacker123", "hacker123@example.com", datetime.now())
|
||||
commit_hash = repo.create_commit("testcommit", Tree(tree_hash, tree), user, user, None)
|
||||
repo.set_unpacked_ref("main", commit_hash)
|
||||
tag_hash = repo.create_annotated_tag("Test tag", repo.get_object(commit_hash), "test", user)
|
||||
if tag_hash: repo.set_unpacked_tag("test", tag_hash)
|
||||
print(blob_hash, tree_hash, commit_hash, tag_hash)
|
||||
Reference in New Issue
Block a user