summaryrefslogtreecommitdiff
path: root/apply.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-11-06 13:11:21 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-11-06 13:11:21 +0900
commit0b646bcac96a57e345887e607e0b8c9a64ff262a (patch)
tree4c4e0e29d1743413c7fa0e1172ccebb7cbc37191 /apply.h
parentGit 2.15 (diff)
parentread_cache: roll back lock in `update_index_if_able()` (diff)
downloadtgif-0b646bcac96a57e345887e607e0b8c9a64ff262a.tar.xz
Merge branch 'ma/lockfile-fixes'
An earlier update made it possible to use an on-stack in-core lockfile structure (as opposed to having to deliberately leak an on-heap one). Many codepaths have been updated to take advantage of this new facility. * ma/lockfile-fixes: read_cache: roll back lock in `update_index_if_able()` read-cache: leave lock in right state in `write_locked_index()` read-cache: drop explicit `CLOSE_LOCK`-flag cache.h: document `write_locked_index()` apply: remove `newfd` from `struct apply_state` apply: move lockfile into `apply_state` cache-tree: simplify locking logic checkout-index: simplify locking logic tempfile: fix documentation on `delete_tempfile()` lockfile: fix documentation on `close_lock_file_gently()` treewide: prefer lockfiles on the stack sha1_file: do not leak `lock_file`
Diffstat (limited to 'apply.h')
-rw-r--r--apply.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/apply.h b/apply.h
index d9b3957703..dc4a019057 100644
--- a/apply.h
+++ b/apply.h
@@ -36,9 +36,8 @@ enum apply_verbosity {
struct apply_state {
const char *prefix;
- /* These are lock_file related */
- struct lock_file *lock_file;
- int newfd;
+ /* Lock file */
+ struct lock_file lock_file;
/* These control what gets looked at and modified */
int apply; /* this is not a dry-run */
@@ -116,8 +115,7 @@ extern int apply_parse_options(int argc, const char **argv,
int *force_apply, int *options,
const char * const *apply_usage);
extern int init_apply_state(struct apply_state *state,
- const char *prefix,
- struct lock_file *lock_file);
+ const char *prefix);
extern void clear_apply_state(struct apply_state *state);
extern int check_apply_state(struct apply_state *state, int force_apply);