Commit 9950bb4e8de076565976128559ff273e9d4a2a78

Carlos Martín Nieto 2014-01-24T20:23:17

diff: rename the file's 'oid' to 'id' In the same vein as the previous commits in this series.

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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 76fb236..d7c2943 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -203,7 +203,7 @@ typedef struct git_diff git_diff;
 typedef enum {
 	GIT_DIFF_FLAG_BINARY     = (1u << 0), /** file(s) treated as binary data */
 	GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /** file(s) treated as text data */
-	GIT_DIFF_FLAG_VALID_OID  = (1u << 2), /** `oid` value is known correct */
+	GIT_DIFF_FLAG_VALID_ID  = (1u << 2), /** `id` value is known correct */
 } git_diff_flag_t;
 
 /**
@@ -250,7 +250,7 @@ typedef enum {
  * be restricted to one of the `git_filemode_t` values.
  */
 typedef struct {
-	git_oid     oid;
+	git_oid     id;
 	const char *path;
 	git_off_t   size;
 	uint32_t    flags;
diff --git a/src/checkout.c b/src/checkout.c
index efd55db..f11ab8d 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -92,10 +92,10 @@ static int checkout_notify(
 	if (wditem) {
 		memset(&wdfile, 0, sizeof(wdfile));
 
-		git_oid_cpy(&wdfile.oid, &wditem->id);
+		git_oid_cpy(&wdfile.id, &wditem->id);
 		wdfile.path = wditem->path;
 		wdfile.size = wditem->file_size;
-		wdfile.flags = GIT_DIFF_FLAG_VALID_OID;
+		wdfile.flags = GIT_DIFF_FLAG_VALID_ID;
 		wdfile.mode = wditem->mode;
 
 		workdir = &wdfile;
@@ -159,7 +159,7 @@ static bool checkout_is_workdir_modified(
 		if (!sm_oid)
 			return false;
 
-		return (git_oid__cmp(&baseitem->oid, sm_oid) != 0);
+		return (git_oid__cmp(&baseitem->id, sm_oid) != 0);
 	}
 
 	/* Look at the cache to decide if the workdir is modified.  If not,
@@ -170,7 +170,7 @@ static bool checkout_is_workdir_modified(
 		if (wditem->mtime.seconds == ie->mtime.seconds &&
 			wditem->mtime.nanoseconds == ie->mtime.nanoseconds &&
 			wditem->file_size == ie->file_size)
-			return (git_oid__cmp(&baseitem->oid, &ie->id) != 0);
+			return (git_oid__cmp(&baseitem->id, &ie->id) != 0);
 	}
 
 	/* depending on where base is coming from, we may or may not know
@@ -184,7 +184,7 @@ static bool checkout_is_workdir_modified(
 			wditem->file_size, &oid) < 0)
 		return false;
 
-	return (git_oid__cmp(&baseitem->oid, &oid) != 0);
+	return (git_oid__cmp(&baseitem->id, &oid) != 0);
 }
 
 #define CHECKOUT_ACTION_IF(FLAG,YES,NO) \
@@ -1221,7 +1221,7 @@ static int checkout_update_index(
 	memset(&entry, 0, sizeof(entry));
 	entry.path = (char *)file->path; /* cast to prevent warning */
 	git_index_entry__init_from_stat(&entry, st, true);
-	git_oid_cpy(&entry.id, &file->oid);
+	git_oid_cpy(&entry.id, &file->id);
 
 	return git_index_add(data->index, &entry);
 }
@@ -1378,7 +1378,7 @@ static int checkout_blob(
 	}
 
 	error = checkout_write_content(
-		data, &file->oid, git_buf_cstr(&data->path), NULL, file->mode, &st);
+		data, &file->id, git_buf_cstr(&data->path), NULL, file->mode, &st);
 
 	/* update the index unless prevented */
 	if (!error && (data->strategy & GIT_CHECKOUT_DONT_UPDATE_INDEX) == 0)
diff --git a/src/diff.c b/src/diff.c
index 75a90a0..151990e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -110,18 +110,18 @@ static int diff_delta__from_one(
 	if (delta->status == GIT_DELTA_DELETED) {
 		delta->old_file.mode = entry->mode;
 		delta->old_file.size = entry->file_size;
-		git_oid_cpy(&delta->old_file.oid, &entry->id);
+		git_oid_cpy(&delta->old_file.id, &entry->id);
 	} else /* ADDED, IGNORED, UNTRACKED */ {
 		delta->new_file.mode = entry->mode;
 		delta->new_file.size = entry->file_size;
-		git_oid_cpy(&delta->new_file.oid, &entry->id);
+		git_oid_cpy(&delta->new_file.id, &entry->id);
 	}
 
-	delta->old_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+	delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 	if (delta->status == GIT_DELTA_DELETED ||
-		!git_oid_iszero(&delta->new_file.oid))
-		delta->new_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+		!git_oid_iszero(&delta->new_file.id))
+		delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 	return diff_insert_delta(diff, delta, matched_pathspec);
 }
@@ -156,24 +156,24 @@ static int diff_delta__from_two(
 	GITERR_CHECK_ALLOC(delta);
 	delta->nfiles = 2;
 
-	git_oid_cpy(&delta->old_file.oid, &old_entry->id);
+	git_oid_cpy(&delta->old_file.id, &old_entry->id);
 	delta->old_file.size = old_entry->file_size;
 	delta->old_file.mode = old_mode;
-	delta->old_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+	delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
-	git_oid_cpy(&delta->new_file.oid, &new_entry->id);
+	git_oid_cpy(&delta->new_file.id, &new_entry->id);
 	delta->new_file.size = new_entry->file_size;
 	delta->new_file.mode = new_mode;
 
 	if (new_oid) {
 		if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE))
-			git_oid_cpy(&delta->old_file.oid, new_oid);
+			git_oid_cpy(&delta->old_file.id, new_oid);
 		else
-			git_oid_cpy(&delta->new_file.oid, new_oid);
+			git_oid_cpy(&delta->new_file.id, new_oid);
 	}
 
 	if (new_oid || !git_oid_iszero(&new_entry->id))
-		delta->new_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+		delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 	return diff_insert_delta(diff, delta, matched_pathspec);
 }
@@ -189,21 +189,21 @@ static git_diff_delta *diff_delta__last_for_item(
 	switch (delta->status) {
 	case GIT_DELTA_UNMODIFIED:
 	case GIT_DELTA_DELETED:
-		if (git_oid__cmp(&delta->old_file.oid, &item->id) == 0)
+		if (git_oid__cmp(&delta->old_file.id, &item->id) == 0)
 			return delta;
 		break;
 	case GIT_DELTA_ADDED:
-		if (git_oid__cmp(&delta->new_file.oid, &item->id) == 0)
+		if (git_oid__cmp(&delta->new_file.id, &item->id) == 0)
 			return delta;
 		break;
 	case GIT_DELTA_UNTRACKED:
 		if (diff->strcomp(delta->new_file.path, item->path) == 0 &&
-			git_oid__cmp(&delta->new_file.oid, &item->id) == 0)
+			git_oid__cmp(&delta->new_file.id, &item->id) == 0)
 			return delta;
 		break;
 	case GIT_DELTA_MODIFIED:
-		if (git_oid__cmp(&delta->old_file.oid, &item->id) == 0 ||
-			git_oid__cmp(&delta->new_file.oid, &item->id) == 0)
+		if (git_oid__cmp(&delta->old_file.id, &item->id) == 0 ||
+			git_oid__cmp(&delta->new_file.id, &item->id) == 0)
 			return delta;
 		break;
 	default:
diff --git a/src/diff.h b/src/diff.h
index 2c9298a..c588f63 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -134,7 +134,7 @@ GIT_INLINE(int) git_diff_file__resolve_zero_size(
 		return error;
 
 	error = git_odb__read_header_or_object(
-		odb_obj, &len, &type, odb, &file->oid);
+		odb_obj, &len, &type, odb, &file->id);
 
 	git_odb_free(odb);
 
diff --git a/src/diff_file.c b/src/diff_file.c
index a4c8641..fb5d674 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -143,10 +143,10 @@ int git_diff_file_content__init_from_blob(
 		fc->flags |= GIT_DIFF_FLAG__NO_DATA;
 	} else {
 		fc->flags |= GIT_DIFF_FLAG__LOADED;
-		fc->file->flags |= GIT_DIFF_FLAG_VALID_OID;
+		fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
 		fc->file->size = git_blob_rawsize(blob);
 		fc->file->mode = GIT_FILEMODE_BLOB;
-		git_oid_cpy(&fc->file->oid, git_blob_id(blob));
+		git_oid_cpy(&fc->file->id, git_blob_id(blob));
 
 		fc->map.len  = (size_t)fc->file->size;
 		fc->map.data = (char *)git_blob_rawcontent(blob);
@@ -171,10 +171,10 @@ int git_diff_file_content__init_from_raw(
 		fc->flags |= GIT_DIFF_FLAG__NO_DATA;
 	} else {
 		fc->flags |= GIT_DIFF_FLAG__LOADED;
-		fc->file->flags |= GIT_DIFF_FLAG_VALID_OID;
+		fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
 		fc->file->size = buflen;
 		fc->file->mode = GIT_FILEMODE_BLOB;
-		git_odb_hash(&fc->file->oid, buf, buflen, GIT_OBJ_BLOB);
+		git_odb_hash(&fc->file->id, buf, buflen, GIT_OBJ_BLOB);
 
 		fc->map.len  = buflen;
 		fc->map.data = (char *)buf;
@@ -205,19 +205,19 @@ static int diff_file_content_commit_to_str(
 		}
 
 		/* update OID if we didn't have it previously */
-		if ((fc->file->flags & GIT_DIFF_FLAG_VALID_OID) == 0 &&
+		if ((fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0 &&
 			((sm_head = git_submodule_wd_id(sm)) != NULL ||
 			 (sm_head = git_submodule_head_id(sm)) != NULL))
 		{
-			git_oid_cpy(&fc->file->oid, sm_head);
-			fc->file->flags |= GIT_DIFF_FLAG_VALID_OID;
+			git_oid_cpy(&fc->file->id, sm_head);
+			fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
 		}
 
 		if (GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
 			status = "-dirty";
 	}
 
-	git_oid_tostr(oid, sizeof(oid), &fc->file->oid);
+	git_oid_tostr(oid, sizeof(oid), &fc->file->id);
 	if (git_buf_printf(&content, "Subproject commit %s%s\n", oid, status) < 0)
 		return -1;
 
@@ -233,7 +233,7 @@ static int diff_file_content_load_blob(git_diff_file_content *fc)
 	int error = 0;
 	git_odb_object *odb_obj = NULL;
 
-	if (git_oid_iszero(&fc->file->oid))
+	if (git_oid_iszero(&fc->file->id))
 		return 0;
 
 	if (fc->file->mode == GIT_FILEMODE_COMMIT)
@@ -255,7 +255,7 @@ static int diff_file_content_load_blob(git_diff_file_content *fc)
 		git_odb_object_free(odb_obj);
 	} else {
 		error = git_blob_lookup(
-			(git_blob **)&fc->blob, fc->repo, &fc->file->oid);
+			(git_blob **)&fc->blob, fc->repo, &fc->file->id);
 	}
 
 	if (!error) {
@@ -368,10 +368,10 @@ static int diff_file_content_load_workdir(git_diff_file_content *fc)
 		error = diff_file_content_load_workdir_file(fc, &path);
 
 	/* once data is loaded, update OID if we didn't have it previously */
-	if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_OID) == 0) {
+	if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0) {
 		error = git_odb_hash(
-			&fc->file->oid, fc->map.data, fc->map.len, GIT_OBJ_BLOB);
-		fc->file->flags |= GIT_DIFF_FLAG_VALID_OID;
+			&fc->file->id, fc->map.data, fc->map.len, GIT_OBJ_BLOB);
+		fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
 	}
 
 	git_buf_free(&path);
diff --git a/src/diff_patch.c b/src/diff_patch.c
index 9c2eb88..ecae3a8 100644
--- a/src/diff_patch.c
+++ b/src/diff_patch.c
@@ -133,9 +133,9 @@ static int diff_patch_load(git_patch *patch, git_diff_output *output)
 
 	incomplete_data =
 		(((patch->ofile.flags & GIT_DIFF_FLAG__NO_DATA) != 0 ||
-		  (patch->ofile.file->flags & GIT_DIFF_FLAG_VALID_OID) != 0) &&
+		  (patch->ofile.file->flags & GIT_DIFF_FLAG_VALID_ID) != 0) &&
 		 ((patch->nfile.flags & GIT_DIFF_FLAG__NO_DATA) != 0 ||
-		  (patch->nfile.file->flags & GIT_DIFF_FLAG_VALID_OID) != 0));
+		  (patch->nfile.file->flags & GIT_DIFF_FLAG_VALID_ID) != 0));
 
 	/* always try to load workdir content first because filtering may
 	 * need 2x data size and this minimizes peak memory footprint
@@ -169,7 +169,7 @@ static int diff_patch_load(git_patch *patch, git_diff_output *output)
 	if (incomplete_data &&
 		patch->ofile.file->mode == patch->nfile.file->mode &&
 		patch->ofile.file->mode != GIT_FILEMODE_COMMIT &&
-		git_oid_equal(&patch->ofile.file->oid, &patch->nfile.file->oid) &&
+		git_oid_equal(&patch->ofile.file->id, &patch->nfile.file->id) &&
 		patch->delta->status == GIT_DELTA_MODIFIED) /* not RENAMED/COPIED! */
 		patch->delta->status = GIT_DELTA_UNMODIFIED;
 
@@ -184,7 +184,7 @@ cleanup:
 			patch->delta->status != GIT_DELTA_UNMODIFIED &&
 			(patch->ofile.map.len || patch->nfile.map.len) &&
 			(patch->ofile.map.len != patch->nfile.map.len ||
-			 !git_oid_equal(&patch->ofile.file->oid, &patch->nfile.file->oid)))
+			 !git_oid_equal(&patch->ofile.file->id, &patch->nfile.file->id)))
 			patch->flags |= GIT_DIFF_PATCH_DIFFABLE;
 
 		patch->flags |= GIT_DIFF_PATCH_LOADED;
@@ -315,7 +315,7 @@ static int diff_single_generate(diff_patch_with_delta *pd, git_xdiff_output *xo)
 		(has_old ? GIT_DELTA_MODIFIED : GIT_DELTA_ADDED) :
 		(has_old ? GIT_DELTA_DELETED : GIT_DELTA_UNTRACKED);
 
-	if (git_oid_equal(&patch->nfile.file->oid, &patch->ofile.file->oid))
+	if (git_oid_equal(&patch->nfile.file->id, &patch->ofile.file->id))
 		pd->delta.status = GIT_DELTA_UNMODIFIED;
 
 	patch->delta = &pd->delta;
diff --git a/src/diff_print.c b/src/diff_print.c
index dd31d1f..5bacc5c 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -170,8 +170,8 @@ static int diff_print_one_raw(
 
 	git_buf_clear(out);
 
-	git_oid_tostr(start_oid, pi->oid_strlen, &delta->old_file.oid);
-	git_oid_tostr(end_oid, pi->oid_strlen, &delta->new_file.oid);
+	git_oid_tostr(start_oid, pi->oid_strlen, &delta->old_file.id);
+	git_oid_tostr(end_oid, pi->oid_strlen, &delta->new_file.id);
 
 	git_buf_printf(
 		out, ":%06o %06o %s... %s... %c",
@@ -203,8 +203,8 @@ static int diff_print_oid_range(
 {
 	char start_oid[GIT_OID_HEXSZ+1], end_oid[GIT_OID_HEXSZ+1];
 
-	git_oid_tostr(start_oid, oid_strlen, &delta->old_file.oid);
-	git_oid_tostr(end_oid, oid_strlen, &delta->new_file.oid);
+	git_oid_tostr(start_oid, oid_strlen, &delta->old_file.id);
+	git_oid_tostr(end_oid, oid_strlen, &delta->new_file.id);
 
 	/* TODO: Match git diff more closely */
 	if (delta->old_file.mode == delta->new_file.mode) {
@@ -235,11 +235,11 @@ static int diff_delta_format_with_paths(
 	const char *oldpath = delta->old_file.path;
 	const char *newpath = delta->new_file.path;
 
-	if (git_oid_iszero(&delta->old_file.oid)) {
+	if (git_oid_iszero(&delta->old_file.id)) {
 		oldpfx = "";
 		oldpath = "/dev/null";
 	}
-	if (git_oid_iszero(&delta->new_file.oid)) {
+	if (git_oid_iszero(&delta->new_file.id)) {
 		newpfx = "";
 		newpath = "/dev/null";
 	}
diff --git a/src/diff_tform.c b/src/diff_tform.c
index fc1b1d5..dfb59a3 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -91,7 +91,7 @@ static git_diff_delta *diff_delta__merge_like_cgit(
 		dup->status = a->status;
 	}
 
-	git_oid_cpy(&dup->old_file.oid, &a->old_file.oid);
+	git_oid_cpy(&dup->old_file.id, &a->old_file.id);
 	dup->old_file.mode  = a->old_file.mode;
 	dup->old_file.size  = a->old_file.size;
 	dup->old_file.flags = a->old_file.flags;
@@ -124,7 +124,7 @@ static git_diff_delta *diff_delta__merge_like_cgit_reversed(
 		dup->status = b->status;
 	}
 
-	git_oid_cpy(&dup->old_file.oid, &b->old_file.oid);
+	git_oid_cpy(&dup->old_file.id, &b->old_file.id);
 	dup->old_file.mode  = b->old_file.mode;
 	dup->old_file.size  = b->old_file.size;
 	dup->old_file.flags = b->old_file.flags;
@@ -375,7 +375,7 @@ static int insert_delete_side_of_split(
 	deleted->nfiles = 1;
 	memset(&deleted->new_file, 0, sizeof(deleted->new_file));
 	deleted->new_file.path = deleted->old_file.path;
-	deleted->new_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+	deleted->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 	return git_vector_insert(onto, deleted);
 }
@@ -408,7 +408,7 @@ static int apply_splits_and_deletes(
 			delta->nfiles = 1;
 			memset(&delta->old_file, 0, sizeof(delta->old_file));
 			delta->old_file.path = delta->new_file.path;
-			delta->old_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+			delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 		}
 
 		/* clean up delta before inserting into new list */
@@ -510,7 +510,7 @@ static int similarity_sig(
 				(git_object **)&info->blob, info->repo,
 				info->odb_obj, GIT_OBJ_BLOB);
 		else
-			error = git_blob_lookup(&info->blob, info->repo, &file->oid);
+			error = git_blob_lookup(&info->blob, info->repo, &file->id);
 
 		if (error < 0) {
 			/* if lookup fails, just skip this item in similarity calc */
@@ -572,21 +572,21 @@ static int similarity_measure(
 
 	/* if exact match is requested, force calculation of missing OIDs now */
 	if (exact_match) {
-		if (git_oid_iszero(&a_file->oid) &&
+		if (git_oid_iszero(&a_file->id) &&
 			diff->old_src == GIT_ITERATOR_TYPE_WORKDIR &&
 			!git_diff__oid_for_file(diff->repo, a_file->path,
-				a_file->mode, a_file->size, &a_file->oid))
-			a_file->flags |= GIT_DIFF_FLAG_VALID_OID;
+				a_file->mode, a_file->size, &a_file->id))
+			a_file->flags |= GIT_DIFF_FLAG_VALID_ID;
 
-		if (git_oid_iszero(&b_file->oid) &&
+		if (git_oid_iszero(&b_file->id) &&
 			diff->new_src == GIT_ITERATOR_TYPE_WORKDIR &&
 			!git_diff__oid_for_file(diff->repo, b_file->path,
-				b_file->mode, b_file->size, &b_file->oid))
-			b_file->flags |= GIT_DIFF_FLAG_VALID_OID;
+				b_file->mode, b_file->size, &b_file->id))
+			b_file->flags |= GIT_DIFF_FLAG_VALID_ID;
 	}
 
 	/* check OID match as a quick test */
-	if (git_oid__cmp(&a_file->oid, &b_file->oid) == 0) {
+	if (git_oid__cmp(&a_file->id, &b_file->id) == 0) {
 		*score = 100;
 		return 0;
 	}
@@ -999,7 +999,7 @@ find_best_matches:
 				memcpy(&src->old_file, &swap, sizeof(src->old_file));
 				memset(&src->new_file, 0, sizeof(src->new_file));
 				src->new_file.path = src->old_file.path;
-				src->new_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+				src->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 				num_updates++;
 
@@ -1024,7 +1024,7 @@ find_best_matches:
 				src->nfiles = 1;
 				memset(&src->old_file, 0, sizeof(src->old_file));
 				src->old_file.path = src->new_file.path;
-				src->old_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+				src->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
 				src->flags &= ~GIT_DIFF_FLAG__TO_SPLIT;
 				num_rewrites--;
diff --git a/src/merge.c b/src/merge.c
index 23a1574..ee000d5 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -665,7 +665,7 @@ static int index_entry_similarity_calc(
 	if ((error = git_blob_lookup(&blob, repo, &entry->id)) < 0)
 		return error;
 
-	git_oid_cpy(&diff_file.oid, &entry->id);
+	git_oid_cpy(&diff_file.id, &entry->id);
 	diff_file.path = entry->path;
 	diff_file.size = entry->file_size;
 	diff_file.mode = entry->mode;
diff --git a/src/merge_file.c b/src/merge_file.c
index 0878866..986fbf9 100644
--- a/src/merge_file.c
+++ b/src/merge_file.c
@@ -108,7 +108,7 @@ int git_merge_file_input_from_diff_file(
 		return 0;
 
 	if ((error = git_repository_odb(&odb, repo)) < 0 ||
-		(error = git_odb_read(&input->odb_object, odb, &file->oid)) < 0)
+		(error = git_odb_read(&input->odb_object, odb, &file->id)) < 0)
 		goto done;
 
 	input->mode = file->mode;
diff --git a/src/reset.c b/src/reset.c
index b9c783b..15f7fe1 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -72,7 +72,7 @@ int git_reset_default(
 				goto cleanup;
 		} else {
 			entry.mode = delta->new_file.mode;
-			git_oid_cpy(&entry.id, &delta->new_file.oid);
+			git_oid_cpy(&entry.id, &delta->new_file.id);
 			entry.path = (char *)delta->new_file.path;
 
 			if ((error = git_index_add(index, &entry)) < 0)
diff --git a/src/status.c b/src/status.c
index 7a1472d..3c95b34 100644
--- a/src/status.c
+++ b/src/status.c
@@ -38,7 +38,7 @@ static unsigned int index_delta2status(const git_diff_delta *head2idx)
 	case GIT_DELTA_RENAMED:
 		st = GIT_STATUS_INDEX_RENAMED;
 
-		if (!git_oid_equal(&head2idx->old_file.oid, &head2idx->new_file.oid))
+		if (!git_oid_equal(&head2idx->old_file.id, &head2idx->new_file.id))
 			st |= GIT_STATUS_INDEX_MODIFIED;
 		break;
 	case GIT_DELTA_TYPECHANGE:
@@ -74,25 +74,25 @@ static unsigned int workdir_delta2status(
 	case GIT_DELTA_RENAMED:
 		st = GIT_STATUS_WT_RENAMED;
 
-		if (!git_oid_equal(&idx2wd->old_file.oid, &idx2wd->new_file.oid)) {
+		if (!git_oid_equal(&idx2wd->old_file.id, &idx2wd->new_file.id)) {
 			/* if OIDs don't match, we might need to calculate them now to
 			 * discern between RENAMED vs RENAMED+MODIFED
 			 */
-			if (git_oid_iszero(&idx2wd->old_file.oid) &&
+			if (git_oid_iszero(&idx2wd->old_file.id) &&
 				diff->old_src == GIT_ITERATOR_TYPE_WORKDIR &&
 				!git_diff__oid_for_file(
 					diff->repo, idx2wd->old_file.path, idx2wd->old_file.mode,
-					idx2wd->old_file.size, &idx2wd->old_file.oid))
-			idx2wd->old_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+					idx2wd->old_file.size, &idx2wd->old_file.id))
+			idx2wd->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
-			if (git_oid_iszero(&idx2wd->new_file.oid) &&
+			if (git_oid_iszero(&idx2wd->new_file.id) &&
 				diff->new_src == GIT_ITERATOR_TYPE_WORKDIR &&
 				!git_diff__oid_for_file(
 					diff->repo, idx2wd->new_file.path, idx2wd->new_file.mode,
-					idx2wd->new_file.size, &idx2wd->new_file.oid))
-				idx2wd->new_file.flags |= GIT_DIFF_FLAG_VALID_OID;
+					idx2wd->new_file.size, &idx2wd->new_file.id))
+				idx2wd->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
 
-			if (!git_oid_equal(&idx2wd->old_file.oid, &idx2wd->new_file.oid))
+			if (!git_oid_equal(&idx2wd->old_file.id, &idx2wd->new_file.id))
 				st |= GIT_STATUS_WT_MODIFIED;
 		}
 		break;
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index 48d6d79..57ce431 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -307,8 +307,8 @@ static int test_checkout_notify_cb(
 
 	cl_assert_equal_i(GIT_CHECKOUT_NOTIFY_CONFLICT, why);
 	cl_assert_equal_s(expectations->file, path);
-	cl_assert_equal_i(0, git_oid_streq(&baseline->oid, expectations->sha));
-	cl_assert_equal_i(0, git_oid_streq(&target->oid, expectations->sha));
+	cl_assert_equal_i(0, git_oid_streq(&baseline->id, expectations->sha));
+	cl_assert_equal_i(0, git_oid_streq(&target->id, expectations->sha));
 
 	return 0;
 }
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index 63e3c5b..17f64c9 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -167,9 +167,9 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_MODIFIED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(a), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(a), &delta->old_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(a), delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(b), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(b), &delta->new_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(b), delta->new_file.size);
 
 	cl_assert_equal_i(1, (int)git_patch_num_hunks(p));
@@ -190,9 +190,9 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_MODIFIED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(b), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(b), &delta->old_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(b), delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(c), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(c), &delta->new_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(c), delta->new_file.size);
 
 	cl_assert_equal_i(1, (int)git_patch_num_hunks(p));
@@ -213,9 +213,9 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_MODIFIED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(a), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(a), &delta->old_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(a), delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(c), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(c), &delta->new_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(c), delta->new_file.size);
 
 	cl_git_pass(git_patch_line_stats(&tc, &ta, &td, p));
@@ -233,9 +233,9 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_MODIFIED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(c), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(c), &delta->old_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(c), delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(d), delta->new_file.size);
 
 	cl_assert_equal_i(2, (int)git_patch_num_hunks(p));
@@ -328,9 +328,9 @@ void test_diff_blob__can_compare_against_null_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_DELETED, delta->status);
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(d), delta->old_file.size);
-	cl_assert(git_oid_iszero(&delta->new_file.oid));
+	cl_assert(git_oid_iszero(&delta->new_file.id));
 	cl_assert_equal_sz(0, delta->new_file.size);
 
 	cl_assert_equal_i(1, (int)git_patch_num_hunks(p));
@@ -353,9 +353,9 @@ void test_diff_blob__can_compare_against_null_blobs_with_patch(void)
 	delta = git_patch_get_delta(p);
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_ADDED, delta->status);
-	cl_assert(git_oid_iszero(&delta->old_file.oid));
+	cl_assert(git_oid_iszero(&delta->old_file.id));
 	cl_assert_equal_sz(0, delta->old_file.size);
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.id));
 	cl_assert_equal_sz(git_blob_rawsize(d), delta->new_file.size);
 
 	cl_assert_equal_i(1, (int)git_patch_num_hunks(p));
@@ -446,9 +446,9 @@ void test_diff_blob__can_compare_identical_blobs_with_patch(void)
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_UNMODIFIED, delta->status);
 	cl_assert_equal_sz(delta->old_file.size, git_blob_rawsize(d));
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(d), &delta->old_file.id));
 	cl_assert_equal_sz(delta->new_file.size, git_blob_rawsize(d));
-	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.oid));
+	cl_assert(git_oid_equal(git_blob_id(d), &delta->new_file.id));
 
 	cl_assert_equal_i(0, (int)git_patch_num_hunks(p));
 	git_patch_free(p);
@@ -460,9 +460,9 @@ void test_diff_blob__can_compare_identical_blobs_with_patch(void)
 	cl_assert(delta != NULL);
 	cl_assert_equal_i(GIT_DELTA_UNMODIFIED, delta->status);
 	cl_assert_equal_sz(0, delta->old_file.size);
-	cl_assert(git_oid_iszero(&delta->old_file.oid));
+	cl_assert(git_oid_iszero(&delta->old_file.id));
 	cl_assert_equal_sz(0, delta->new_file.size);
-	cl_assert(git_oid_iszero(&delta->new_file.oid));
+	cl_assert(git_oid_iszero(&delta->new_file.id));
 
 	cl_assert_equal_i(0, (int)git_patch_num_hunks(p));
 	git_patch_free(p);