diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/attr.c | 4 | ||||
-rw-r--r-- | src/checkout.c | 22 | ||||
-rw-r--r-- | src/commit.c | 4 | ||||
-rw-r--r-- | src/crlf.c | 2 | ||||
-rw-r--r-- | src/diff.c | 46 | ||||
-rw-r--r-- | src/diff.h | 2 | ||||
-rw-r--r-- | src/diff_file.c | 26 | ||||
-rw-r--r-- | src/diff_patch.c | 10 | ||||
-rw-r--r-- | src/diff_print.c | 16 | ||||
-rw-r--r-- | src/diff_tform.c | 28 | ||||
-rw-r--r-- | src/index.c | 18 | ||||
-rw-r--r-- | src/iterator.c | 2 | ||||
-rw-r--r-- | src/merge.c | 32 | ||||
-rw-r--r-- | src/merge_file.c | 4 | ||||
-rw-r--r-- | src/notes.c | 8 | ||||
-rw-r--r-- | src/notes.h | 2 | ||||
-rw-r--r-- | src/reset.c | 2 | ||||
-rw-r--r-- | src/status.c | 18 | ||||
-rw-r--r-- | src/submodule.c | 12 | ||||
-rw-r--r-- | src/tree.c | 8 |
20 files changed, 133 insertions, 133 deletions
diff --git a/src/attr.c b/src/attr.c index e6e274e42..ff4446e2f 100644 --- a/src/attr.c +++ b/src/attr.c @@ -314,10 +314,10 @@ static int load_attr_blob_from_index( entry = git_index_get_byindex(index, pos); - if (old_oid && git_oid__cmp(old_oid, &entry->oid) == 0) + if (old_oid && git_oid__cmp(old_oid, &entry->id) == 0) return GIT_ENOTFOUND; - if ((error = git_blob_lookup(blob, repo, &entry->oid)) < 0) + if ((error = git_blob_lookup(blob, repo, &entry->id)) < 0) return error; *content = git_blob_rawcontent(*blob); diff --git a/src/checkout.c b/src/checkout.c index 6769cbc3d..f11ab8d46 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->oid); + 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->oid) != 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) \ @@ -700,21 +700,21 @@ GIT_INLINE(int) checkout_conflict_detect_binary(git_repository *repo, checkout_c return 0; if (conflict->ancestor) { - if ((error = git_blob_lookup(&ancestor_blob, repo, &conflict->ancestor->oid)) < 0) + if ((error = git_blob_lookup(&ancestor_blob, repo, &conflict->ancestor->id)) < 0) goto done; conflict->binary = git_blob_is_binary(ancestor_blob); } if (!conflict->binary && conflict->ours) { - if ((error = git_blob_lookup(&our_blob, repo, &conflict->ours->oid)) < 0) + if ((error = git_blob_lookup(&our_blob, repo, &conflict->ours->id)) < 0) goto done; conflict->binary = git_blob_is_binary(our_blob); } if (!conflict->binary && conflict->theirs) { - if ((error = git_blob_lookup(&their_blob, repo, &conflict->theirs->oid)) < 0) + if ((error = git_blob_lookup(&their_blob, repo, &conflict->theirs->id)) < 0) goto done; conflict->binary = git_blob_is_binary(their_blob); @@ -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.oid, &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) @@ -1631,7 +1631,7 @@ static int checkout_write_entry( return error; return checkout_write_content(data, - &side->oid, git_buf_cstr(&data->path), hint_path, side->mode, &st); + &side->id, git_buf_cstr(&data->path), hint_path, side->mode, &st); } static int checkout_write_entries( diff --git a/src/commit.c b/src/commit.c index e437cffe6..da7c4992e 100644 --- a/src/commit.c +++ b/src/commit.c @@ -69,7 +69,7 @@ int git_commit_create_v( return res; } -int git_commit_create_from_oids( +int git_commit_create_from_ids( git_oid *oid, git_repository *repo, const char *update_ref, @@ -148,7 +148,7 @@ int git_commit_create( parent_oids[i] = git_object_id((const git_object *)parents[i]); } - retval = git_commit_create_from_oids( + retval = git_commit_create_from_ids( oid, repo, update_ref, author, committer, message_encoding, message, git_object_id((const git_object *)tree), parent_count, parent_oids); diff --git a/src/crlf.c b/src/crlf.c index b25c02cce..e1bd5572b 100644 --- a/src/crlf.c +++ b/src/crlf.c @@ -101,7 +101,7 @@ static int has_cr_in_index(const git_filter_source *src) if (!S_ISREG(entry->mode)) /* don't crlf filter non-blobs */ return true; - if (git_blob_lookup(&blob, repo, &entry->oid) < 0) + if (git_blob_lookup(&blob, repo, &entry->id) < 0) return false; blobcontent = git_blob_rawcontent(blob); diff --git a/src/diff.c b/src/diff.c index 7f2e58c0c..151990ed6 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->oid); + 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->oid); + 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->oid); + 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->oid); + 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->oid)) - delta->new_file.flags |= GIT_DIFF_FLAG_VALID_OID; + if (new_oid || !git_oid_iszero(&new_entry->id)) + 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->oid) == 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->oid) == 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->oid) == 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->oid) == 0 || - git_oid__cmp(&delta->new_file.oid, &item->oid) == 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: @@ -629,7 +629,7 @@ static int maybe_modified_submodule( /* now that we have a HEAD OID, check if HEAD moved */ if ((sm_status & GIT_SUBMODULE_STATUS_IN_WD) != 0 && - !git_oid_equal(&info->oitem->oid, found_oid)) + !git_oid_equal(&info->oitem->id, found_oid)) *status = GIT_DELTA_MODIFIED; return 0; @@ -689,15 +689,15 @@ static int maybe_modified( } /* if oids and modes match (and are valid), then file is unmodified */ - else if (git_oid_equal(&oitem->oid, &nitem->oid) && + else if (git_oid_equal(&oitem->id, &nitem->id) && omode == nmode && - !git_oid_iszero(&oitem->oid)) + !git_oid_iszero(&oitem->id)) status = GIT_DELTA_UNMODIFIED; /* if we have an unknown OID and a workdir iterator, then check some * circumstances that can accelerate things or need special handling */ - else if (git_oid_iszero(&nitem->oid) && new_is_workdir) { + else if (git_oid_iszero(&nitem->id) && new_is_workdir) { bool use_ctime = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_CTIME) != 0); bool use_nanos = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_NANOSECS) != 0); @@ -732,7 +732,7 @@ static int maybe_modified( /* if we got here and decided that the files are modified, but we * haven't calculated the OID of the new item, then calculate it now */ - if (status == GIT_DELTA_MODIFIED && git_oid_iszero(&nitem->oid)) { + if (status == GIT_DELTA_MODIFIED && git_oid_iszero(&nitem->id)) { if (git_oid_iszero(&noid)) { if ((error = git_diff__oid_for_file(diff->repo, nitem->path, nitem->mode, nitem->file_size, &noid)) < 0) @@ -744,7 +744,7 @@ static int maybe_modified( * matches between the index and the workdir HEAD) */ if (omode == nmode && !S_ISGITLINK(omode) && - git_oid_equal(&oitem->oid, &noid)) + git_oid_equal(&oitem->id, &noid)) status = GIT_DELTA_UNMODIFIED; } diff --git a/src/diff.h b/src/diff.h index 2c9298a5f..c588f6301 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 a4c8641bc..fb5d674f7 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 9c2eb885f..ecae3a8ed 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 dd31d1ffa..1a09bed54 100644 --- a/src/diff_print.c +++ b/src/diff_print.c @@ -37,8 +37,8 @@ static int diff_print_info_init( if (diff) pi->flags = diff->opts.flags; - if (diff && diff->opts.oid_abbrev != 0) - pi->oid_strlen = diff->opts.oid_abbrev; + if (diff && diff->opts.id_abbrev != 0) + pi->oid_strlen = diff->opts.id_abbrev; else if (!diff || !diff->repo) pi->oid_strlen = GIT_ABBREV_DEFAULT; else if (git_repository__cvar( @@ -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 fc1b1d586..dfb59a3f8 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/index.c b/src/index.c index bb81f666e..d58968454 100644 --- a/src/index.c +++ b/src/index.c @@ -643,7 +643,7 @@ static int index_entry_init( git_index_entry__init_from_stat(entry, &st, !index->distrust_filemode); - entry->oid = oid; + entry->id = oid; entry->path = git__strdup(rel_path); GITERR_CHECK_ALLOC(entry->path); @@ -757,9 +757,9 @@ static int index_conflict_to_reuc(git_index *index, const char *path) our_mode = conflict_entries[1] == NULL ? 0 : conflict_entries[1]->mode; their_mode = conflict_entries[2] == NULL ? 0 : conflict_entries[2]->mode; - ancestor_oid = conflict_entries[0] == NULL ? NULL : &conflict_entries[0]->oid; - our_oid = conflict_entries[1] == NULL ? NULL : &conflict_entries[1]->oid; - their_oid = conflict_entries[2] == NULL ? NULL : &conflict_entries[2]->oid; + ancestor_oid = conflict_entries[0] == NULL ? NULL : &conflict_entries[0]->id; + our_oid = conflict_entries[1] == NULL ? NULL : &conflict_entries[1]->id; + their_oid = conflict_entries[2] == NULL ? NULL : &conflict_entries[2]->id; if ((ret = git_index_reuc_add(index, path, ancestor_mode, ancestor_oid, our_mode, our_oid, their_mode, their_oid)) >= 0) @@ -1515,7 +1515,7 @@ static size_t read_entry(git_index_entry *dest, const void *buffer, size_t buffe dest->uid = ntohl(source->uid); dest->gid = ntohl(source->gid); dest->file_size = ntohl(source->file_size); - git_oid_cpy(&dest->oid, &source->oid); + git_oid_cpy(&dest->id, &source->oid); dest->flags = ntohs(source->flags); if (dest->flags & GIT_IDXENTRY_EXTENDED) { @@ -1756,7 +1756,7 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry) ondisk->gid = htonl(entry->gid); ondisk->file_size = htonl((uint32_t)entry->file_size); - git_oid_cpy(&ondisk->oid, &entry->oid); + git_oid_cpy(&ondisk->oid, &entry->id); ondisk->flags = htons(entry->flags); @@ -1983,7 +1983,7 @@ static int read_tree_cb( GITERR_CHECK_ALLOC(entry); entry->mode = tentry->attr; - entry->oid = tentry->oid; + entry->id = tentry->oid; /* look for corresponding old entry and copy data to new entry */ if (data->old_entries) { @@ -1997,7 +1997,7 @@ static int read_tree_cb( &pos, data->old_entries, data->entries_search, &skey) && (old_entry = git_vector_get(data->old_entries, pos)) != NULL && entry->mode == old_entry->mode && - git_oid_equal(&entry->oid, &old_entry->oid)) + git_oid_equal(&entry->id, &old_entry->id)) { memcpy(entry, old_entry, sizeof(*entry)); entry->flags_extended = 0; @@ -2135,7 +2135,7 @@ int git_index_add_all( error = -1; break; } - entry->oid = blobid; + entry->id = blobid; /* add working directory item to index */ if ((error = index_insert(index, entry, 1)) < 0) { diff --git a/src/iterator.c b/src/iterator.c index 0e7d0db85..401b5de93 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -447,7 +447,7 @@ static int tree_iterator__update_entry(tree_iterator *ti) te = tf->entries[tf->current]->te; ti->entry.mode = te->attr; - git_oid_cpy(&ti->entry.oid, &te->oid); + git_oid_cpy(&ti->entry.id, &te->oid); ti->entry.path = tree_iterator__current_filename(ti, te); GITERR_CHECK_ALLOC(ti->entry.path); diff --git a/src/merge.c b/src/merge.c index 2fb1c5898..f4224955a 100644 --- a/src/merge.c +++ b/src/merge.c @@ -317,7 +317,7 @@ GIT_INLINE(int) index_entry_cmp(const git_index_entry *a, const git_index_entry return (b->path == NULL) ? 0 : 1; if ((value = a->mode - b->mode) == 0 && - (value = git_oid__cmp(&a->oid, &b->oid)) == 0) + (value = git_oid__cmp(&a->id, &b->id)) == 0) value = strcmp(a->path, b->path); return value; @@ -478,12 +478,12 @@ static int merge_conflict_resolve_one_renamed( conflict->type == GIT_MERGE_DIFF_RENAMED_ADDED) return 0; - ours_changed = (git_oid__cmp(&conflict->ancestor_entry.oid, &conflict->our_entry.oid) != 0); - theirs_changed = (git_oid__cmp(&conflict->ancestor_entry.oid, &conflict->their_entry.oid) != 0); + ours_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->our_entry.id) != 0); + theirs_changed = (git_oid__cmp(&conflict->ancestor_entry.id, &conflict->their_entry.id) != 0); /* if both are modified (and not to a common target) require a merge */ if (ours_changed && theirs_changed && - git_oid__cmp(&conflict->our_entry.oid, &conflict->their_entry.oid) != 0) + git_oid__cmp(&conflict->our_entry.id, &conflict->their_entry.id) != 0) return 0; if ((merged = git_pool_malloc(&diff_list->pool, sizeof(git_index_entry))) == NULL) @@ -575,7 +575,7 @@ static int merge_conflict_resolve_automerge( index_entry->file_size = result.len; index_entry->mode = result.mode; - git_oid_cpy(&index_entry->oid, &automerge_oid); + git_oid_cpy(&index_entry->id, &automerge_oid); git_vector_insert(&diff_list->staged, index_entry); git_vector_insert(&diff_list->resolved, (git_merge_diff *)conflict); @@ -643,7 +643,7 @@ static int index_entry_similarity_exact( GIT_UNUSED(cache); GIT_UNUSED(opts); - if (git_oid__cmp(&a->oid, &b->oid) == 0) + if (git_oid__cmp(&a->id, &b->id) == 0) return 100; return 0; @@ -662,10 +662,10 @@ static int index_entry_similarity_calc( *out = NULL; - if ((error = git_blob_lookup(&blob, repo, &entry->oid)) < 0) + if ((error = git_blob_lookup(&blob, repo, &entry->id)) < 0) return error; - git_oid_cpy(&diff_file.oid, &entry->oid); + git_oid_cpy(&diff_file.id, &entry->id); diff_file.path = entry->path; diff_file.size = entry->file_size; diff_file.mode = entry->mode; @@ -1163,7 +1163,7 @@ GIT_INLINE(int) merge_diff_detect_binary( int error = 0; if (GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->ancestor_entry)) { - if ((error = git_blob_lookup(&ancestor_blob, repo, &conflict->ancestor_entry.oid)) < 0) + if ((error = git_blob_lookup(&ancestor_blob, repo, &conflict->ancestor_entry.id)) < 0) goto done; conflict->binary = git_blob_is_binary(ancestor_blob); @@ -1171,7 +1171,7 @@ GIT_INLINE(int) merge_diff_detect_binary( if (!conflict->binary && GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->our_entry)) { - if ((error = git_blob_lookup(&our_blob, repo, &conflict->our_entry.oid)) < 0) + if ((error = git_blob_lookup(&our_blob, repo, &conflict->our_entry.id)) < 0) goto done; conflict->binary = git_blob_is_binary(our_blob); @@ -1179,7 +1179,7 @@ GIT_INLINE(int) merge_diff_detect_binary( if (!conflict->binary && GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->their_entry)) { - if ((error = git_blob_lookup(&their_blob, repo, &conflict->their_entry.oid)) < 0) + if ((error = git_blob_lookup(&their_blob, repo, &conflict->their_entry.id)) < 0) goto done; conflict->binary = git_blob_is_binary(their_blob); @@ -1222,7 +1222,7 @@ GIT_INLINE(int) merge_delta_type_from_index_entries( return GIT_DELTA_TYPECHANGE; else if(S_ISLNK(ancestor->mode) ^ S_ISLNK(other->mode)) return GIT_DELTA_TYPECHANGE; - else if (git_oid__cmp(&ancestor->oid, &other->oid) || + else if (git_oid__cmp(&ancestor->id, &other->id) || ancestor->mode != other->mode) return GIT_DELTA_MODIFIED; @@ -1497,7 +1497,7 @@ static int merge_index_insert_reuc( } mode[idx] = entry->mode; - oid[idx] = &entry->oid; + oid[idx] = &entry->id; return git_index_reuc_add(index, entry->path, mode[0], oid[0], mode[1], oid[1], mode[2], oid[2]); @@ -2111,7 +2111,7 @@ static int merge_ancestor_head( if ((error = git_merge_base_many(&ancestor_oid, repo, their_heads_len + 1, oids)) < 0) goto on_error; - error = git_merge_head_from_oid(ancestor_head, repo, &ancestor_oid); + error = git_merge_head_from_id(ancestor_head, repo, &ancestor_oid); on_error: git__free(oids); @@ -2615,7 +2615,7 @@ int git_merge_result_is_fastforward(git_merge_result *merge_result) return merge_result->is_fastforward; } -int git_merge_result_fastforward_oid(git_oid *out, git_merge_result *merge_result) +int git_merge_result_fastforward_id(git_oid *out, git_merge_result *merge_result) { assert(out && merge_result); @@ -2699,7 +2699,7 @@ int git_merge_head_from_ref( return error; } -int git_merge_head_from_oid( +int git_merge_head_from_id( git_merge_head **out, git_repository *repo, const git_oid *oid) diff --git a/src/merge_file.c b/src/merge_file.c index 9961ef297..986fbf9fe 100644 --- a/src/merge_file.c +++ b/src/merge_file.c @@ -77,7 +77,7 @@ int git_merge_file_input_from_index_entry( return 0; if ((error = git_repository_odb(&odb, repo)) < 0 || - (error = git_odb_read(&input->odb_object, odb, &entry->oid)) < 0) + (error = git_odb_read(&input->odb_object, odb, &entry->id)) < 0) goto done; input->mode = entry->mode; @@ -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/notes.c b/src/notes.c index 795904917..ffe5d345a 100644 --- a/src/notes.c +++ b/src/notes.c @@ -313,7 +313,7 @@ static int note_new(git_note **out, git_oid *note_oid, git_blob *blob) note = (git_note *)git__malloc(sizeof(git_note)); GITERR_CHECK_ALLOC(note); - git_oid_cpy(¬e->oid, note_oid); + git_oid_cpy(¬e->id, note_oid); note->message = git__strdup((char *)git_blob_rawcontent(blob)); GITERR_CHECK_ALLOC(note->message); @@ -508,10 +508,10 @@ const char * git_note_message(const git_note *note) return note->message; } -const git_oid * git_note_oid(const git_note *note) +const git_oid * git_note_id(const git_note *note) { assert(note); - return ¬e->oid; + return ¬e->id; } void git_note_free(git_note *note) @@ -640,7 +640,7 @@ int git_note_next( if ((error = git_iterator_current(&item, it)) < 0) return error; - git_oid_cpy(note_id, &item->oid); + git_oid_cpy(note_id, &item->id); if (!(error = process_entry_path(item->path, annotated_id))) git_iterator_advance(NULL, it); diff --git a/src/notes.h b/src/notes.h index 39e18b621..e9cfa00fa 100644 --- a/src/notes.h +++ b/src/notes.h @@ -21,7 +21,7 @@ "Notes removed by 'git_note_remove' from libgit2" struct git_note { - git_oid oid; + git_oid id; char *message; }; diff --git a/src/reset.c b/src/reset.c index 32e101357..15f7fe13a 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.oid, &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 7a1472d8d..3c95b347c 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/src/submodule.c b/src/submodule.c index 3ffbfdba4..720681db9 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -387,7 +387,7 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index) error = -1; goto cleanup; } - git_oid_cpy(&entry.oid, &sm->wd_oid); + git_oid_cpy(&entry.id, &sm->wd_oid); if ((error = git_commit_lookup(&head, sm_repo, &sm->wd_oid)) < 0) goto cleanup; @@ -780,7 +780,7 @@ static void submodule_update_from_index_entry( if (already_found) sm->flags |= GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES; else - git_oid_cpy(&sm->index_oid, &ie->oid); + git_oid_cpy(&sm->index_oid, &ie->id); sm->flags |= GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS__INDEX_OID_VALID; @@ -1281,7 +1281,7 @@ static int load_submodule_config_from_index( if (!submodule_get(&sm, repo, entry->path, NULL)) submodule_update_from_index_entry(sm, entry); } else if (strcmp(entry->path, GIT_MODULES_FILE) == 0) - git_oid_cpy(gitmodules_oid, &entry->oid); + git_oid_cpy(gitmodules_oid, &entry->id); } if (error == GIT_ITEROVER) @@ -1320,16 +1320,16 @@ static int load_submodule_config_from_head( if (S_ISGITLINK(entry->mode)) submodule_update_from_head_data( - sm, entry->mode, &entry->oid); + sm, entry->mode, &entry->id); else sm->flags |= GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE; } else if (S_ISGITLINK(entry->mode)) { if (!submodule_get(&sm, repo, entry->path, NULL)) submodule_update_from_head_data( - sm, entry->mode, &entry->oid); + sm, entry->mode, &entry->id); } else if (strcmp(entry->path, GIT_MODULES_FILE) == 0 && git_oid_iszero(gitmodules_oid)) { - git_oid_cpy(gitmodules_oid, &entry->oid); + git_oid_cpy(gitmodules_oid, &entry->id); } } diff --git a/src/tree.c b/src/tree.c index fc105ed5e..877a3fcee 100644 --- a/src/tree.c +++ b/src/tree.c @@ -305,8 +305,8 @@ const git_tree_entry *git_tree_entry_byindex( return git_vector_get(&tree->entries, idx); } -const git_tree_entry *git_tree_entry_byoid( - const git_tree *tree, const git_oid *oid) +const git_tree_entry *git_tree_entry_byid( + const git_tree *tree, const git_oid *id) { size_t i; const git_tree_entry *e; @@ -314,7 +314,7 @@ const git_tree_entry *git_tree_entry_byoid( assert(tree); git_vector_foreach(&tree->entries, i, e) { - if (memcmp(&e->oid.id, &oid->id, sizeof(oid->id)) == 0) + if (memcmp(&e->oid.id, &id->id, sizeof(id->id)) == 0) return e; } @@ -551,7 +551,7 @@ static int write_tree( if (error < 0) goto on_error; } else { - error = append_entry(bld, filename, &entry->oid, entry->mode); + error = append_entry(bld, filename, &entry->id, entry->mode); if (error < 0) goto on_error; } |