Skip to content

Commit 4c9a5d7

Browse files
committed
Merge branch 'ps/maintenance-ref-lock'
"git maintenance" lacked the care "git gc" had to avoid holding onto the repository lock for too long during packing refs, which has been remedied. * ps/maintenance-ref-lock: builtin/maintenance: fix locking race when handling "gc" task builtin/gc: avoid global state in `gc_before_repack()` usage: allow dying without writing an error message builtin/maintenance: fix locking race with refs and reflogs tasks builtin/maintenance: split into foreground and background tasks builtin/maintenance: fix typedef for function pointers builtin/maintenance: extract function to run tasks builtin/maintenance: stop modifying global array of tasks builtin/maintenance: mark "--task=" and "--schedule=" as incompatible builtin/maintenance: centralize configuration of explicit tasks builtin/gc: drop redundant local variable builtin/gc: use designated field initializers for maintenance tasks
2 parents a5cc6a2 + 1b5074e commit 4c9a5d7

File tree

7 files changed

+263
-190
lines changed

7 files changed

+263
-190
lines changed

builtin/am.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,
10001000

10011001
if (!patch_format) {
10021002
fprintf_ln(stderr, _("Patch format detection failed."));
1003-
exit(128);
1003+
die(NULL);
10041004
}
10051005

10061006
if (mkdir(state->dir, 0777) < 0 && errno != EEXIST)
@@ -1178,7 +1178,7 @@ static void NORETURN die_user_resolve(const struct am_state *state)
11781178
strbuf_release(&sb);
11791179
}
11801180

1181-
exit(128);
1181+
die(NULL);
11821182
}
11831183

11841184
/**

builtin/checkout.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
838838
init_tree_desc(&trees[0], &tree->object.oid,
839839
tree->buffer, tree->size);
840840
if (parse_tree(new_tree) < 0)
841-
exit(128);
841+
die(NULL);
842842
tree = new_tree;
843843
init_tree_desc(&trees[1], &tree->object.oid,
844844
tree->buffer, tree->size);
@@ -913,7 +913,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
913913
work,
914914
old_tree);
915915
if (ret < 0)
916-
exit(128);
916+
die(NULL);
917917
ret = reset_tree(new_tree,
918918
opts, 0,
919919
writeout_error, new_branch_info);

builtin/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static int update_local_ref(struct ref *ref,
992992
fast_forward = repo_in_merge_bases(the_repository, current,
993993
updated);
994994
if (fast_forward < 0)
995-
exit(128);
995+
die(NULL);
996996
forced_updates_ms += (getnanotime() - t_before) / 1000000;
997997
} else {
998998
fast_forward = 1;

0 commit comments

Comments
 (0)