initial commit

This commit is contained in:
KubaPro010
2025-11-14 22:22:34 +01:00
commit c3df0f26a9
4 changed files with 613 additions and 0 deletions

12
test.py Normal file
View 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)