diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 44 | ||||
-rw-r--r-- | src/diff_output.c | 34 | ||||
-rw-r--r-- | src/status.c | 2 |
3 files changed, 40 insertions, 40 deletions
diff --git a/src/diff.c b/src/diff.c index dcc0aef6a..a0fd5fdf1 100644 --- a/src/diff.c +++ b/src/diff.c @@ -29,7 +29,7 @@ static void diff_delta__free(git_diff_delta *delta) static git_diff_delta *diff_delta__alloc( git_diff_list *diff, - git_status_t status, + git_delta_t status, const char *path) { git_diff_delta *delta = git__calloc(1, sizeof(git_diff_delta)); @@ -46,8 +46,8 @@ static git_diff_delta *diff_delta__alloc( if (diff->opts.flags & GIT_DIFF_REVERSE) { switch (status) { - case GIT_STATUS_ADDED: status = GIT_STATUS_DELETED; break; - case GIT_STATUS_DELETED: status = GIT_STATUS_ADDED; break; + case GIT_DELTA_ADDED: status = GIT_DELTA_DELETED; break; + case GIT_DELTA_DELETED: status = GIT_DELTA_ADDED; break; default: break; /* leave other status values alone */ } } @@ -112,16 +112,16 @@ static git_diff_delta *diff_delta__merge_like_cgit( * those choices so we can emulate the type of diff. */ if (git_oid_cmp(&dup->old.oid, &dup->new.oid) == 0) { - if (dup->status == GIT_STATUS_DELETED) + if (dup->status == GIT_DELTA_DELETED) /* preserve pending delete info */; - else if (b->status == GIT_STATUS_UNTRACKED || - b->status == GIT_STATUS_IGNORED) + else if (b->status == GIT_DELTA_UNTRACKED || + b->status == GIT_DELTA_IGNORED) dup->status = b->status; else - dup->status = GIT_STATUS_UNMODIFIED; + dup->status = GIT_DELTA_UNMODIFIED; } - else if (dup->status == GIT_STATUS_UNMODIFIED || - b->status == GIT_STATUS_DELETED) + else if (dup->status == GIT_DELTA_UNMODIFIED || + b->status == GIT_DELTA_DELETED) dup->status = b->status; return dup; @@ -129,7 +129,7 @@ static git_diff_delta *diff_delta__merge_like_cgit( static int diff_delta__from_one( git_diff_list *diff, - git_status_t status, + git_delta_t status, const git_index_entry *entry) { int error; @@ -138,9 +138,9 @@ static int diff_delta__from_one( return git__rethrow(GIT_ENOMEM, "Could not allocate diff record"); /* This fn is just for single-sided diffs */ - assert(status != GIT_STATUS_MODIFIED); + assert(status != GIT_DELTA_MODIFIED); - if (delta->status == GIT_STATUS_DELETED) { + if (delta->status == GIT_DELTA_DELETED) { delta->old.mode = entry->mode; delta->old.size = entry->file_size; git_oid_cpy(&delta->old.oid, &entry->oid); @@ -161,7 +161,7 @@ static int diff_delta__from_one( static int diff_delta__from_two( git_diff_list *diff, - git_status_t status, + git_delta_t status, const git_index_entry *old, const git_index_entry *new, git_oid *new_oid) @@ -333,9 +333,9 @@ static int maybe_modified( return GIT_SUCCESS; if (GIT_MODE_TYPE(oitem->mode) != GIT_MODE_TYPE(nitem->mode)) { - error = diff_delta__from_one(diff, GIT_STATUS_DELETED, oitem); + error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem); if (error == GIT_SUCCESS) - error = diff_delta__from_one(diff, GIT_STATUS_ADDED, nitem); + error = diff_delta__from_one(diff, GIT_DELTA_ADDED, nitem); return error; } @@ -370,7 +370,7 @@ static int maybe_modified( } return diff_delta__from_two( - diff, GIT_STATUS_MODIFIED, oitem, nitem, use_noid); + diff, GIT_DELTA_MODIFIED, oitem, nitem, use_noid); } static int diff_from_iterators( @@ -401,7 +401,7 @@ static int diff_from_iterators( /* create DELETED records for old items not matched in new */ if (oitem && (!nitem || strcmp(oitem->path, nitem->path) < 0)) { - error = diff_delta__from_one(diff, GIT_STATUS_DELETED, oitem); + error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem); if (error == GIT_SUCCESS) error = git_iterator_advance(old, &oitem); continue; @@ -412,7 +412,7 @@ static int diff_from_iterators( */ if (nitem && (!oitem || strcmp(oitem->path, nitem->path) > 0)) { int is_ignored; - git_status_t use_status = GIT_STATUS_ADDED; + git_delta_t delta_type = GIT_DELTA_ADDED; /* contained in ignored parent directory, so this can be skipped. */ if (ignore_prefix != NULL && @@ -431,14 +431,14 @@ static int diff_from_iterators( error = git_iterator_advance_into_directory(new, &nitem); continue; } - use_status = GIT_STATUS_UNTRACKED; + delta_type = GIT_DELTA_UNTRACKED; } else if (is_ignored) - use_status = GIT_STATUS_IGNORED; + delta_type = GIT_DELTA_IGNORED; else if (new->type == GIT_ITERATOR_WORKDIR) - use_status = GIT_STATUS_UNTRACKED; + delta_type = GIT_DELTA_UNTRACKED; - error = diff_delta__from_one(diff, use_status, nitem); + error = diff_delta__from_one(diff, delta_type, nitem); if (error == GIT_SUCCESS) error = git_iterator_advance(new, &nitem); continue; diff --git a/src/diff_output.c b/src/diff_output.c index b800be933..84935182d 100644 --- a/src/diff_output.c +++ b/src/diff_output.c @@ -309,14 +309,14 @@ int git_diff_foreach( git_blob *old_blob = NULL, *new_blob = NULL; git_map old_data, new_data; - if (delta->status == GIT_STATUS_UNMODIFIED) + if (delta->status == GIT_DELTA_UNMODIFIED) continue; - if (delta->status == GIT_STATUS_IGNORED && + if (delta->status == GIT_DELTA_IGNORED && (diff->opts.flags & GIT_DIFF_INCLUDE_IGNORED) == 0) continue; - if (delta->status == GIT_STATUS_UNTRACKED && + if (delta->status == GIT_DELTA_UNTRACKED && (diff->opts.flags & GIT_DIFF_INCLUDE_UNTRACKED) == 0) continue; @@ -337,8 +337,8 @@ int git_diff_foreach( /* map files */ if (delta->binary != 1 && (hunk_cb || line_cb) && - (delta->status == GIT_STATUS_DELETED || - delta->status == GIT_STATUS_MODIFIED)) + (delta->status == GIT_DELTA_DELETED || + delta->status == GIT_DELTA_MODIFIED)) { if (diff->old_src == GIT_ITERATOR_WORKDIR) error = get_workdir_content(diff->repo, &delta->old, &old_data); @@ -351,8 +351,8 @@ int git_diff_foreach( if (delta->binary != 1 && (hunk_cb || line_cb || git_oid_iszero(&delta->new.oid)) && - (delta->status == GIT_STATUS_ADDED || - delta->status == GIT_STATUS_MODIFIED)) + (delta->status == GIT_DELTA_ADDED || + delta->status == GIT_DELTA_MODIFIED)) { if (diff->new_src == GIT_ITERATOR_WORKDIR) error = get_workdir_content(diff->repo, &delta->new, &new_data); @@ -372,7 +372,7 @@ int git_diff_foreach( * incorrect status and need to skip this item. */ if (git_oid_cmp(&delta->old.oid, &delta->new.oid) == 0) { - delta->status = GIT_STATUS_UNMODIFIED; + delta->status = GIT_DELTA_UNMODIFIED; goto cleanup; } } @@ -451,13 +451,13 @@ static int print_compact(void *data, git_diff_delta *delta, float progress) GIT_UNUSED(progress); switch (delta->status) { - case GIT_STATUS_ADDED: code = 'A'; break; - case GIT_STATUS_DELETED: code = 'D'; break; - case GIT_STATUS_MODIFIED: code = 'M'; break; - case GIT_STATUS_RENAMED: code = 'R'; break; - case GIT_STATUS_COPIED: code = 'C'; break; - case GIT_STATUS_IGNORED: code = 'I'; break; - case GIT_STATUS_UNTRACKED: code = '?'; break; + case GIT_DELTA_ADDED: code = 'A'; break; + case GIT_DELTA_DELETED: code = 'D'; break; + case GIT_DELTA_MODIFIED: code = 'M'; break; + case GIT_DELTA_RENAMED: code = 'R'; break; + case GIT_DELTA_COPIED: code = 'C'; break; + case GIT_DELTA_IGNORED: code = 'I'; break; + case GIT_DELTA_UNTRACKED: code = '?'; break; default: code = 0; } @@ -695,8 +695,8 @@ int git_diff_blobs( /* populate a "fake" delta record */ delta.status = old.ptr ? - (new.ptr ? GIT_STATUS_MODIFIED : GIT_STATUS_DELETED) : - (new.ptr ? GIT_STATUS_ADDED : GIT_STATUS_UNTRACKED); + (new.ptr ? GIT_DELTA_MODIFIED : GIT_DELTA_DELETED) : + (new.ptr ? GIT_DELTA_ADDED : GIT_DELTA_UNTRACKED); delta.old.mode = 0100644; /* can't know the truth from a blob alone */ delta.new.mode = 0100644; git_oid_cpy(&delta.old.oid, git_object_id((const git_object *)old_blob)); diff --git a/src/status.c b/src/status.c index 76ae83138..106e5005d 100644 --- a/src/status.c +++ b/src/status.c @@ -131,7 +131,7 @@ static int status_entry_update_ignore(struct status_entry *e, git_ignores *ignor if ((error = git_ignore__lookup(ignores, path, &ignored)) == GIT_SUCCESS && ignored) e->status_flags = - (e->status_flags & ~GIT_STATUS_WT_NEW) | GIT_STATUS_WT_IGNORED; + (e->status_flags & ~GIT_STATUS_WT_NEW) | GIT_STATUS_IGNORED; return error; } |