1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 import nimgit2
type
NimGitTypes = git_clone_options | git_status_options | git_checkout_options |
git_oid | git_diff_options
GitTypes = git_repository | git_config | git_reference | git_remote | git_tag |
git_strarray | git_object | git_commit | git_status_list |
git_annotated_commit | git_tree_entry | git_revwalk | git_buf |
git_pathspec | git_tree | git_diff | git_pathspec_match_list |
git_branch_iterator | git_signature | git_blob | git_patch
proc free* [T: NimGitTypes] (point: ptr T) = dealloc(point)
proc free* [T: GitTypes] (point: ptr T) =
## perform a free of a git-managed pointer
when T is git_repository:
git_repository_free(point)
elif T is git_config:
git_config_free(point)
elif T is git_reference:
git_reference_free(point)
elif T is git_remote:
git_remote_free(point)
elif T is git_strarray:
git_strarray_dispose(point)
elif T is git_tag:
git_tag_free(point)
elif T is git_commit:
git_commit_free(point)
elif T is git_object:
git_object_free(point)
elif T is git_tree:
git_tree_free(point)
elif T is git_tree_entry:
git_tree_entry_free(point)
elif T is git_revwalk:
git_revwalk_free(point)
elif T is git_status_list:
git_status_list_free(point)
elif T is git_annotated_commit:
git_annotated_commit_free(point)
elif T is git_pathspec:
git_pathspec_free(point)
elif T is git_pathspec_match_list:
git_pathspec_match_list_free(point)
elif T is git_diff:
git_diff_free(point)
elif T is git_buf:
git_buf_dispose(point)
elif T is git_branch_iterator:
git_branch_iterator_free(point)
elif T is git_signature:
git_signature_free(point)
elif T is git_blob:
git_blob_free(point)
elif T is git_patch:
git_patch_free(point)