vendor/libgit2/src/checkout.c in rugged-0.24.6.1 vs vendor/libgit2/src/checkout.c in rugged-0.25.0b1

- old
+ new

@@ -462,12 +462,11 @@ *action = CHECKOUT_ACTION_IF(FORCE, REMOVE, CONFLICT); else *action = CHECKOUT_ACTION_IF(SAFE, REMOVE, NONE); break; case GIT_DELTA_MODIFIED: /* case 16, 17, 18 (or 36 but not really) */ - if (wd->mode != GIT_FILEMODE_COMMIT && - checkout_is_workdir_modified(data, &delta->old_file, &delta->new_file, wd)) + if (checkout_is_workdir_modified(data, &delta->old_file, &delta->new_file, wd)) *action = CHECKOUT_ACTION_IF(FORCE, UPDATE_BLOB, CONFLICT); else *action = CHECKOUT_ACTION_IF(SAFE, UPDATE_BLOB, NONE); break; case GIT_DELTA_TYPECHANGE: /* case 22, 23, 29, 30 */ @@ -1341,15 +1340,13 @@ return error; } static bool should_remove_existing(checkout_data *data) { - int ignorecase; + int ignorecase = 0; - if (git_repository__cvar(&ignorecase, data->repo, GIT_CVAR_IGNORECASE) < 0) { - ignorecase = 0; - } + git_repository__cvar(&ignorecase, data->repo, GIT_CVAR_IGNORECASE); return (ignorecase && (data->strategy & GIT_CHECKOUT_DONT_REMOVE_EXISTING) == 0); } @@ -2406,17 +2403,12 @@ &data->can_symlink, repo, GIT_CVAR_SYMLINKS)) < 0) goto cleanup; if (!data->opts.baseline && !data->opts.baseline_index) { data->opts_free_baseline = true; - error = 0; - /* if we don't have an index, this is an initial checkout and - * should be against an empty baseline - */ - if (data->index->on_disk) - error = checkout_lookup_head_tree(&data->opts.baseline, repo); + error = checkout_lookup_head_tree(&data->opts.baseline, repo); if (error == GIT_EUNBORNBRANCH) { error = 0; giterr_clear(); } @@ -2697,10 +2689,10 @@ } if ((error = git_repository_index(&index, repo)) < 0) return error; - if (opts && (opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) { + if ((opts->checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH)) { iter_opts.pathlist.count = opts->paths.count; iter_opts.pathlist.strings = opts->paths.strings; } if (!(error = git_iterator_for_tree(&tree_i, tree, &iter_opts)))