mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-21 20:14:44 +00:00
Fix some formatting inconsistency
This commit is contained in:
parent
61c00541ac
commit
5fa7e46984
@ -327,8 +327,7 @@ static git_diff_list *diff_list_alloc(
|
|||||||
/* Use case-insensitive compare if either iterator has
|
/* Use case-insensitive compare if either iterator has
|
||||||
* the ignore_case bit set */
|
* the ignore_case bit set */
|
||||||
if (!git_iterator_ignore_case(old_iter) &&
|
if (!git_iterator_ignore_case(old_iter) &&
|
||||||
!git_iterator_ignore_case(new_iter))
|
!git_iterator_ignore_case(new_iter)) {
|
||||||
{
|
|
||||||
diff->opts.flags &= ~GIT_DIFF_DELTAS_ARE_ICASE;
|
diff->opts.flags &= ~GIT_DIFF_DELTAS_ARE_ICASE;
|
||||||
|
|
||||||
diff->strcomp = git__strcmp;
|
diff->strcomp = git__strcmp;
|
||||||
@ -777,8 +776,7 @@ static int handle_unmatched_new_item(
|
|||||||
|
|
||||||
/* if not already inside an ignored dir, check if this is ignored */
|
/* if not already inside an ignored dir, check if this is ignored */
|
||||||
if (delta_type != GIT_DELTA_IGNORED &&
|
if (delta_type != GIT_DELTA_IGNORED &&
|
||||||
git_iterator_current_is_ignored(info->new_iter))
|
git_iterator_current_is_ignored(info->new_iter)) {
|
||||||
{
|
|
||||||
delta_type = GIT_DELTA_IGNORED;
|
delta_type = GIT_DELTA_IGNORED;
|
||||||
git_buf_sets(&info->ignore_prefix, nitem->path);
|
git_buf_sets(&info->ignore_prefix, nitem->path);
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,8 @@ static bool diff_delta_is_binary_forced(
|
|||||||
|
|
||||||
/* make sure files are conceivably mmap-able */
|
/* make sure files are conceivably mmap-able */
|
||||||
if ((git_off_t)((size_t)delta->old_file.size) != delta->old_file.size ||
|
if ((git_off_t)((size_t)delta->old_file.size) != delta->old_file.size ||
|
||||||
(git_off_t)((size_t)delta->new_file.size) != delta->new_file.size)
|
(git_off_t)((size_t)delta->new_file.size) != delta->new_file.size) {
|
||||||
{
|
|
||||||
delta->old_file.flags |= GIT_DIFF_FLAG_BINARY;
|
delta->old_file.flags |= GIT_DIFF_FLAG_BINARY;
|
||||||
delta->new_file.flags |= GIT_DIFF_FLAG_BINARY;
|
delta->new_file.flags |= GIT_DIFF_FLAG_BINARY;
|
||||||
delta->flags |= GIT_DIFF_FLAG_BINARY;
|
delta->flags |= GIT_DIFF_FLAG_BINARY;
|
||||||
@ -232,8 +232,7 @@ static int get_blob_content(
|
|||||||
if (git_oid_iszero(&file->oid))
|
if (git_oid_iszero(&file->oid))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (file->mode == GIT_FILEMODE_COMMIT)
|
if (file->mode == GIT_FILEMODE_COMMIT) {
|
||||||
{
|
|
||||||
char oidstr[GIT_OID_HEXSZ+1];
|
char oidstr[GIT_OID_HEXSZ+1];
|
||||||
git_buf content = GIT_BUF_INIT;
|
git_buf content = GIT_BUF_INIT;
|
||||||
|
|
||||||
@ -299,8 +298,8 @@ static int get_workdir_sm_content(
|
|||||||
char oidstr[GIT_OID_HEXSZ+1];
|
char oidstr[GIT_OID_HEXSZ+1];
|
||||||
|
|
||||||
if ((error = git_submodule_lookup(&sm, ctxt->repo, file->path)) < 0 ||
|
if ((error = git_submodule_lookup(&sm, ctxt->repo, file->path)) < 0 ||
|
||||||
(error = git_submodule_status(&sm_status, sm)) < 0)
|
(error = git_submodule_status(&sm_status, sm)) < 0) {
|
||||||
{
|
|
||||||
/* GIT_EEXISTS means a "submodule" that has not been git added */
|
/* GIT_EEXISTS means a "submodule" that has not been git added */
|
||||||
if (error == GIT_EEXISTS)
|
if (error == GIT_EEXISTS)
|
||||||
error = 0;
|
error = 0;
|
||||||
@ -312,8 +311,8 @@ static int get_workdir_sm_content(
|
|||||||
const git_oid* sm_head;
|
const git_oid* sm_head;
|
||||||
|
|
||||||
if ((sm_head = git_submodule_wd_id(sm)) != NULL ||
|
if ((sm_head = git_submodule_wd_id(sm)) != NULL ||
|
||||||
(sm_head = git_submodule_head_id(sm)) != NULL)
|
(sm_head = git_submodule_head_id(sm)) != NULL) {
|
||||||
{
|
|
||||||
git_oid_cpy(&file->oid, sm_head);
|
git_oid_cpy(&file->oid, sm_head);
|
||||||
file->flags |= GIT_DIFF_FLAG_VALID_OID;
|
file->flags |= GIT_DIFF_FLAG_VALID_OID;
|
||||||
}
|
}
|
||||||
@ -660,8 +659,8 @@ static int diff_patch_load(
|
|||||||
*/
|
*/
|
||||||
if (check_if_unmodified &&
|
if (check_if_unmodified &&
|
||||||
delta->old_file.mode == delta->new_file.mode &&
|
delta->old_file.mode == delta->new_file.mode &&
|
||||||
!git_oid__cmp(&delta->old_file.oid, &delta->new_file.oid))
|
!git_oid__cmp(&delta->old_file.oid, &delta->new_file.oid)) {
|
||||||
{
|
|
||||||
delta->status = GIT_DELTA_UNMODIFIED;
|
delta->status = GIT_DELTA_UNMODIFIED;
|
||||||
|
|
||||||
if ((ctxt->opts->flags & GIT_DIFF_INCLUDE_UNMODIFIED) == 0)
|
if ((ctxt->opts->flags & GIT_DIFF_INCLUDE_UNMODIFIED) == 0)
|
||||||
@ -1049,6 +1048,12 @@ char git_diff_status_char(git_delta_t status)
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int callback_error(void)
|
||||||
|
{
|
||||||
|
giterr_clear();
|
||||||
|
return GIT_EUSER;
|
||||||
|
}
|
||||||
|
|
||||||
static int print_compact(
|
static int print_compact(
|
||||||
const git_diff_delta *delta, float progress, void *data)
|
const git_diff_delta *delta, float progress, void *data)
|
||||||
{
|
{
|
||||||
@ -1083,10 +1088,7 @@ static int print_compact(
|
|||||||
|
|
||||||
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
|
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
|
||||||
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
||||||
{
|
return callback_error();
|
||||||
giterr_clear();
|
|
||||||
return GIT_EUSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1200,10 +1202,7 @@ static int print_patch_file(
|
|||||||
|
|
||||||
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
|
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_FILE_HDR,
|
||||||
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
||||||
{
|
return callback_error();
|
||||||
giterr_clear();
|
|
||||||
return GIT_EUSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0)
|
if ((delta->flags & GIT_DIFF_FLAG_BINARY) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1217,10 +1216,7 @@ static int print_patch_file(
|
|||||||
|
|
||||||
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_BINARY,
|
if (pi->print_cb(delta, NULL, GIT_DIFF_LINE_BINARY,
|
||||||
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
||||||
{
|
return callback_error();
|
||||||
giterr_clear();
|
|
||||||
return GIT_EUSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1243,10 +1239,7 @@ static int print_patch_hunk(
|
|||||||
|
|
||||||
if (pi->print_cb(d, r, GIT_DIFF_LINE_HUNK_HDR,
|
if (pi->print_cb(d, r, GIT_DIFF_LINE_HUNK_HDR,
|
||||||
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
||||||
{
|
return callback_error();
|
||||||
giterr_clear();
|
|
||||||
return GIT_EUSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1278,10 +1271,7 @@ static int print_patch_line(
|
|||||||
|
|
||||||
if (pi->print_cb(delta, range, line_origin,
|
if (pi->print_cb(delta, range, line_origin,
|
||||||
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
git_buf_cstr(pi->buf), git_buf_len(pi->buf), pi->payload))
|
||||||
{
|
return callback_error();
|
||||||
giterr_clear();
|
|
||||||
return GIT_EUSER;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user