diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-01-24 11:36:41 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-01-25 08:15:44 +0100 |
commit | d541170c77b7ac738e2ffcdd04c838fb7cbbfb87 (patch) | |
tree | b4c829668eb8a1aa8db798bfdd31e95bb1a946e0 /src | |
parent | d0a3de720e085d335d9ad46dc00a23dd03eda793 (diff) | |
download | libgit2-d541170c77b7ac738e2ffcdd04c838fb7cbbfb87.tar.gz |
index: rename an entry's id to 'id'
This was not converted when we converted the rest, so do it now.
Diffstat (limited to 'src')
-rw-r--r-- | src/attr.c | 4 | ||||
-rw-r--r-- | src/checkout.c | 14 | ||||
-rw-r--r-- | src/crlf.c | 2 | ||||
-rw-r--r-- | src/diff.c | 32 | ||||
-rw-r--r-- | src/index.c | 18 | ||||
-rw-r--r-- | src/iterator.c | 2 | ||||
-rw-r--r-- | src/merge.c | 26 | ||||
-rw-r--r-- | src/merge_file.c | 2 | ||||
-rw-r--r-- | src/notes.c | 2 | ||||
-rw-r--r-- | src/reset.c | 2 | ||||
-rw-r--r-- | src/submodule.c | 12 | ||||
-rw-r--r-- | src/tree.c | 2 |
12 files changed, 59 insertions, 59 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..efd55db65 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -92,7 +92,7 @@ static int checkout_notify( if (wditem) { memset(&wdfile, 0, sizeof(wdfile)); - git_oid_cpy(&wdfile.oid, &wditem->oid); + git_oid_cpy(&wdfile.oid, &wditem->id); wdfile.path = wditem->path; wdfile.size = wditem->file_size; wdfile.flags = GIT_DIFF_FLAG_VALID_OID; @@ -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->oid, &ie->id) != 0); } /* depending on where base is coming from, we may or may not know @@ -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->oid); return git_index_add(data->index, &entry); } @@ -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/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..75a90a0b2 100644 --- a/src/diff.c +++ b/src/diff.c @@ -110,11 +110,11 @@ 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.oid, &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.oid, &entry->id); } delta->old_file.flags |= GIT_DIFF_FLAG_VALID_OID; @@ -156,12 +156,12 @@ 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.oid, &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; - git_oid_cpy(&delta->new_file.oid, &new_entry->oid); + git_oid_cpy(&delta->new_file.oid, &new_entry->id); delta->new_file.size = new_entry->file_size; delta->new_file.mode = new_mode; @@ -172,7 +172,7 @@ static int diff_delta__from_two( git_oid_cpy(&delta->new_file.oid, new_oid); } - if (new_oid || !git_oid_iszero(&new_entry->oid)) + if (new_oid || !git_oid_iszero(&new_entry->id)) delta->new_file.flags |= GIT_DIFF_FLAG_VALID_OID; 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.oid, &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.oid, &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.oid, &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.oid, &item->id) == 0 || + git_oid__cmp(&delta->new_file.oid, &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/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..23a1574f7 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.oid, &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]); diff --git a/src/merge_file.c b/src/merge_file.c index 9961ef297..0878866bc 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; diff --git a/src/notes.c b/src/notes.c index 1ff0e35c3..ffe5d345a 100644 --- a/src/notes.c +++ b/src/notes.c @@ -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/reset.c b/src/reset.c index 32e101357..b9c783be3 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.oid); entry.path = (char *)delta->new_file.path; if ((error = git_index_add(index, &entry)) < 0) 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..3fb544e4d 100644 --- a/src/tree.c +++ b/src/tree.c @@ -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; } |