Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
pks-t committed May 27, 2024
1 parent c41aeeb commit dc5a349
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions refs/reftable-backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static int reftable_be_remove_on_disk(struct ref_store *ref_store,
fflush(stderr);

strbuf_addf(&sb, "%s/HEAD", refs->base.gitdir);
if (remove_path(sb.buf) < 0) {
if (unlink(sb.buf) < 0) {
strbuf_addstr(err, "could not delete stub HEAD");
ret = -1;

Expand All @@ -388,13 +388,27 @@ static int reftable_be_remove_on_disk(struct ref_store *ref_store,
fflush(stderr);

strbuf_addf(&sb, "%s/refs/heads", refs->base.gitdir);
if (remove_path(sb.buf) < 0) {
if (unlink(sb.buf) < 0) {
strbuf_addstr(err, "could not delete stub heads");
ret = -1;

fputs(sb.buf, stderr);
fflush(stderr);
}
strbuf_reset(&sb);

fputs("removal: remove refs/\n", stderr);
fflush(stderr);

strbuf_addf(&sb, "%s/refs/heads", refs->base.gitdir);
if (rmdir(sb.buf) < 0) {
strbuf_addstr(err, "could not delete stub heads");
ret = -1;

fputs(sb.buf, stderr);
fflush(stderr);
}
strbuf_reset(&sb);

fputs("removal: done\n", stderr);
fflush(stderr);
Expand Down

0 comments on commit dc5a349

Please sign in to comment.