Skip to content

Commit e5f6798

Browse files
committed
Adjust to oid -> id renaming
1 parent dd6fc97 commit e5f6798

File tree

15 files changed

+69
-69
lines changed

15 files changed

+69
-69
lines changed

docs/diff.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Attributes:
5050

5151
.. autoattribute:: pygit2.Patch.old_file_path
5252
.. autoattribute:: pygit2.Patch.new_file_path
53-
.. autoattribute:: pygit2.Patch.old_oid
54-
.. autoattribute:: pygit2.Patch.new_oid
53+
.. autoattribute:: pygit2.Patch.old_id
54+
.. autoattribute:: pygit2.Patch.new_id
5555
.. autoattribute:: pygit2.Patch.status
5656
.. autoattribute:: pygit2.Patch.similarity
5757
.. autoattribute:: pygit2.Patch.hunks

docs/merge.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ merge with the default ones defined in GIT_MERGE_OPTS_INIT libgit2 constant.
2222
Example::
2323

2424
>>> branch_head_hex = '5ebeeebb320790caf276b9fc8b24546d63316533'
25-
>>> branch_oid = self.repo.get(branch_head_hex).id
26-
>>> merge_result = self.repo.merge(branch_oid)
25+
>>> branch_id = self.repo.get(branch_head_hex).id
26+
>>> merge_result = self.repo.merge(branch_id)
2727

2828
The MergeResult object
2929
======================
@@ -33,5 +33,5 @@ Represents the result of a merge and contains these fields:
3333
- is_uptodate: bool, if there wasn't any merge because the repo was already
3434
up to date
3535
- is_fastforward: bool, whether the merge was fastforward or not
36-
- fastforward_oid: Oid, in the case it was a fastforward, this is the
37-
forwarded Oid.
36+
- fastforward_id: Oid, in the case it was a fastforward, this is the
37+
forwarded id.

docs/objects.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ type.
1414
Object lookup
1515
=================
1616

17-
In the previous chapter we learnt about Object IDs. With an oid we can ask the
17+
In the previous chapter we learnt about Object IDs. With an Oid we can ask the
1818
repository to get the associated object. To do that the ``Repository`` class
1919
implementes a subset of the mapping interface.
2020

2121
.. automethod:: pygit2.Repository.get
2222

23-
Return the Git object for the given *oid*, returns the *default* value if
24-
there's no object in the repository with that oid. The oid can be an Oid
23+
Return the Git object for the given *id*, returns the *default* value if
24+
there's no object in the repository with that id. The id can be an Oid
2525
object, or an hexadecimal string.
2626

2727
Example::
@@ -32,16 +32,16 @@ implementes a subset of the mapping interface.
3232
>>> obj
3333
<_pygit2.Commit object at 0x7ff27a6b60f0>
3434

35-
.. method:: Repository.__getitem__(oid)
35+
.. method:: Repository.__getitem__(id)
3636

37-
Return the Git object for the given oid, raise ``KeyError`` if there's no
38-
object in the repository with that oid. The oid can be an Oid object, or
37+
Return the Git object for the given id, raise ``KeyError`` if there's no
38+
object in the repository with that id. The id can be an Oid object, or
3939
an hexadecimal string.
4040

41-
.. method:: Repository.__contains__(oid)
41+
.. method:: Repository.__contains__(id)
4242

43-
Returns True if there is an object in the Repository with that oid, False
44-
if there is not. The oid can be an Oid object, or an hexadecimal string.
43+
Returns True if there is an object in the Repository with that id, False
44+
if there is not. The id can be an Oid object, or an hexadecimal string.
4545

4646

4747
The Object base type
@@ -125,15 +125,15 @@ them to the Git object database:
125125

126126
Example:
127127

128-
>>> oid = repo.create_blob('foo bar') # Creates blob from bytes string
129-
>>> blob = repo[oid]
128+
>>> id = repo.create_blob('foo bar') # Creates blob from bytes string
129+
>>> blob = repo[id]
130130
>>> blob.data
131131
'foo bar'
132132

133133
.. automethod:: pygit2.Repository.create_blob_fromworkdir
134134
.. automethod:: pygit2.Repository.create_blob_fromdisk
135135

136-
There are also some functions to calculate the oid for a byte string without
136+
There are also some functions to calculate the id for a byte string without
137137
creating the blob object:
138138

139139
.. autofunction:: pygit2.hash

docs/references.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Example::
9292
>>> for entry in head.log():
9393
... print(entry.message)
9494

95-
.. autoattribute:: pygit2.RefLogEntry.oid_new
96-
.. autoattribute:: pygit2.RefLogEntry.oid_old
95+
.. autoattribute:: pygit2.RefLogEntry.id_new
96+
.. autoattribute:: pygit2.RefLogEntry.id_old
9797
.. autoattribute:: pygit2.RefLogEntry.message
9898
.. autoattribute:: pygit2.RefLogEntry.committer
9999

@@ -109,6 +109,6 @@ The Note type
109109
--------------------
110110

111111
.. autoattribute:: pygit2.Note.annotated_id
112-
.. autoattribute:: pygit2.Note.oid
112+
.. autoattribute:: pygit2.Note.id
113113
.. autoattribute:: pygit2.Note.message
114114
.. automethod:: pygit2.Note.remove

docs/working-copy.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Index read::
88

99
>>> index = repo.index
1010
>>> index.read()
11-
>>> oid = index['path/to/file'].id # from path to object id
12-
>>> blob = repo[oid] # from object id to object
11+
>>> id = index['path/to/file'].id # from path to object id
12+
>>> blob = repo[id] # from object id to object
1313

1414
Iterate over all entries of the index::
1515

@@ -43,7 +43,7 @@ The Index type
4343
The IndexEntry type
4444
--------------------
4545

46-
.. autoattribute:: pygit2.IndexEntry.oid
46+
.. autoattribute:: pygit2.IndexEntry.id
4747
.. autoattribute:: pygit2.IndexEntry.hex
4848
.. autoattribute:: pygit2.IndexEntry.path
4949
.. autoattribute:: pygit2.IndexEntry.mode

src/diff.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ wrap_patch(git_patch *patch)
8080
py_patch->status = git_diff_status_char(delta->status);
8181
py_patch->similarity = delta->similarity;
8282
py_patch->flags = delta->flags;
83-
py_patch->old_oid = git_oid_allocfmt(&delta->old_file.oid);
84-
py_patch->new_oid = git_oid_allocfmt(&delta->new_file.oid);
83+
py_patch->old_id = git_oid_allocfmt(&delta->old_file.id);
84+
py_patch->new_id = git_oid_allocfmt(&delta->new_file.id);
8585

8686
git_patch_line_stats(NULL, &additions, &deletions, patch);
8787
py_patch->additions = additions;
@@ -149,8 +149,8 @@ static void
149149
Patch_dealloc(Patch *self)
150150
{
151151
Py_CLEAR(self->hunks);
152-
free(self->old_oid);
153-
free(self->new_oid);
152+
free(self->old_id);
153+
free(self->new_id);
154154
/* We do not have to free old_file_path and new_file_path, they will
155155
* be freed by git_diff_list_free in Diff_dealloc */
156156
PyObject_Del(self);
@@ -159,8 +159,8 @@ Patch_dealloc(Patch *self)
159159
PyMemberDef Patch_members[] = {
160160
MEMBER(Patch, old_file_path, T_STRING, "old file path"),
161161
MEMBER(Patch, new_file_path, T_STRING, "new file path"),
162-
MEMBER(Patch, old_oid, T_STRING, "old oid"),
163-
MEMBER(Patch, new_oid, T_STRING, "new oid"),
162+
MEMBER(Patch, old_id, T_STRING, "old oid"),
163+
MEMBER(Patch, new_id, T_STRING, "new oid"),
164164
MEMBER(Patch, status, T_CHAR, "status"),
165165
MEMBER(Patch, similarity, T_INT, "similarity"),
166166
MEMBER(Patch, hunks, T_OBJECT, "hunks"),

src/index.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ IndexEntry_init(IndexEntry *self, PyObject *args, PyObject *kwds)
628628
return -1;
629629

630630
if (id)
631-
git_oid_cpy(&self->entry.oid, &id->oid);
631+
git_oid_cpy(&self->entry.id, &id->oid);
632632

633633
if (mode)
634634
self->entry.mode = mode;
@@ -689,18 +689,18 @@ IndexEntry_path__set__(IndexEntry *self, PyObject *py_path)
689689
return 0;
690690
}
691691

692-
PyDoc_STRVAR(IndexEntry_oid__doc__, "Object id.");
692+
PyDoc_STRVAR(IndexEntry_id__doc__, "Object id.");
693693

694694
PyObject *
695-
IndexEntry_oid__get__(IndexEntry *self)
695+
IndexEntry_id__get__(IndexEntry *self)
696696
{
697-
return git_oid_to_python(&self->entry.oid);
697+
return git_oid_to_python(&self->entry.id);
698698
}
699699

700700
int
701-
IndexEntry_oid__set__(IndexEntry *self, PyObject *py_id)
701+
IndexEntry_id__set__(IndexEntry *self, PyObject *py_id)
702702
{
703-
if (!py_oid_to_git_oid(py_id, &self->entry.oid))
703+
if (!py_oid_to_git_oid(py_id, &self->entry.id))
704704
return -1;
705705

706706
return 0;
@@ -711,13 +711,13 @@ PyDoc_STRVAR(IndexEntry_hex__doc__, "Hex id.");
711711
PyObject *
712712
IndexEntry_hex__get__(IndexEntry *self)
713713
{
714-
return git_oid_to_py_str(&self->entry.oid);
714+
return git_oid_to_py_str(&self->entry.id);
715715
}
716716

717717
PyGetSetDef IndexEntry_getseters[] = {
718718
GETSET(IndexEntry, mode),
719719
GETSET(IndexEntry, path),
720-
GETSET(IndexEntry, oid),
720+
GETSET(IndexEntry, id),
721721
GETTER(IndexEntry, hex),
722722
{NULL},
723723
};

src/mergeresult.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,23 @@ MergeResult_is_fastforward__get__(MergeResult *self)
8080
Py_RETURN_FALSE;
8181
}
8282

83-
PyDoc_STRVAR(MergeResult_fastforward_oid__doc__, "Fastforward Oid");
83+
PyDoc_STRVAR(MergeResult_fastforward_id__doc__, "Fastforward Oid");
8484

8585
PyObject *
86-
MergeResult_fastforward_oid__get__(MergeResult *self)
86+
MergeResult_fastforward_id__get__(MergeResult *self)
8787
{
8888
if (git_merge_result_is_fastforward(self->result)) {
89-
git_oid fastforward_oid;
90-
git_merge_result_fastforward_oid(&fastforward_oid, self->result);
91-
return git_oid_to_python((const git_oid *)&fastforward_oid);
89+
git_oid fastforward_id;
90+
git_merge_result_fastforward_id(&fastforward_id, self->result);
91+
return git_oid_to_python((const git_oid *)&fastforward_id);
9292
}
9393
else Py_RETURN_NONE;
9494
}
9595

9696
PyGetSetDef MergeResult_getseters[] = {
9797
GETTER(MergeResult, is_uptodate),
9898
GETTER(MergeResult, is_fastforward),
99-
GETTER(MergeResult, fastforward_oid),
99+
GETTER(MergeResult, fastforward_id),
100100
{NULL},
101101
};
102102

src/note.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ Note_remove(Note *self, PyObject* args)
6666
}
6767

6868

69-
PyDoc_STRVAR(Note_oid__doc__,
69+
PyDoc_STRVAR(Note_id__doc__,
7070
"Gets the id of the blob containing the note message\n");
7171

7272
PyObject *
73-
Note_oid__get__(Note *self)
73+
Note_id__get__(Note *self)
7474
{
75-
return git_oid_to_python(git_note_oid(self->note));
75+
return git_oid_to_python(git_note_id(self->note));
7676
}
7777

7878

@@ -108,7 +108,7 @@ PyMemberDef Note_members[] = {
108108

109109
PyGetSetDef Note_getseters[] = {
110110
GETTER(Note, message),
111-
GETTER(Note, oid),
111+
GETTER(Note, id),
112112
{NULL}
113113
};
114114

src/repository.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,9 @@ Repository_merge_base(Repository *self, PyObject *args)
588588
}
589589

590590
PyDoc_STRVAR(Repository_merge__doc__,
591-
"merge(oid) -> MergeResult\n"
591+
"merge(id) -> MergeResult\n"
592592
"\n"
593-
"Merges the given oid and returns the MergeResult.\n"
593+
"Merges the given id and returns the MergeResult.\n"
594594
"\n"
595595
"If the merge is fastforward the MergeResult will contain the new\n"
596596
"fastforward oid.\n"
@@ -614,7 +614,7 @@ Repository_merge(Repository *self, PyObject *py_oid)
614614
if (len == 0)
615615
return NULL;
616616

617-
err = git_merge_head_from_oid(&oid_merge_head, self->repo, &oid);
617+
err = git_merge_head_from_id(&oid_merge_head, self->repo, &oid);
618618
if (err < 0)
619619
return Error_set(err);
620620

0 commit comments

Comments
 (0)