summaryrefslogtreecommitdiff
path: root/apply.c
diff options
context:
space:
mode:
Diffstat (limited to 'apply.c')
-rw-r--r--apply.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/apply.c b/apply.c
index 01793d6126..f15afa9f6a 100644
--- a/apply.c
+++ b/apply.c
@@ -56,6 +56,10 @@ static int parse_whitespace_option(struct apply_state *state, const char *option
state->ws_error_action = correct_ws_error;
return 0;
}
+ /*
+ * Please update $__git_whitespacelist in git-completion.bash
+ * when you add new options.
+ */
return error(_("unrecognized whitespace option '%s'"), option);
}
@@ -467,7 +471,6 @@ static char *squash_slash(char *name)
static char *find_name_gnu(struct apply_state *state,
const char *line,
- const char *def,
int p_value)
{
struct strbuf name = STRBUF_INIT;
@@ -714,7 +717,7 @@ static char *find_name(struct apply_state *state,
int terminate)
{
if (*line == '"') {
- char *name = find_name_gnu(state, line, def, p_value);
+ char *name = find_name_gnu(state, line, p_value);
if (name)
return name;
}
@@ -731,7 +734,7 @@ static char *find_name_traditional(struct apply_state *state,
size_t date_len;
if (*line == '"') {
- char *name = find_name_gnu(state, line, def, p_value);
+ char *name = find_name_gnu(state, line, p_value);
if (name)
return name;
}
@@ -3183,7 +3186,7 @@ static int apply_binary(struct apply_state *state,
return 0; /* deletion patch */
}
- if (has_sha1_file(oid.hash)) {
+ if (has_object_file(&oid)) {
/* We already have the postimage */
enum object_type type;
unsigned long size;
@@ -3352,7 +3355,8 @@ static int checkout_target(struct index_state *istate,
costate.refresh_cache = 1;
costate.istate = istate;
- if (checkout_entry(ce, &costate, NULL) || lstat(ce->name, st))
+ if (checkout_entry(ce, &costate, NULL, NULL) ||
+ lstat(ce->name, st))
return error(_("cannot checkout %s"), ce->name);
return 0;
}
@@ -4019,7 +4023,7 @@ static int read_apply_cache(struct apply_state *state)
return read_index_from(state->repo->index, state->index_file,
get_git_dir());
else
- return read_index(state->repo->index);
+ return repo_read_index(state->repo);
}
/* This function tries to read the object name from the current index */
@@ -4712,7 +4716,8 @@ static int apply_patch(struct apply_state *state,
state->index_file,
LOCK_DIE_ON_ERROR);
else
- hold_locked_index(&state->lock_file, LOCK_DIE_ON_ERROR);
+ repo_hold_locked_index(state->repo, &state->lock_file,
+ LOCK_DIE_ON_ERROR);
}
if (state->check_index && read_apply_cache(state) < 0) {