diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-01-02 13:51:30 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-01-02 13:51:30 -0800 |
| commit | dbf668a1b7d814b4fcb57c292934cbbc2d926490 (patch) | |
| tree | 147f6a9d23df350ae6c8e24094a4c973e306ad2c /builtin | |
| parent | Merge branch 'jc/orphan-unborn' (diff) | |
| parent | bisect: consistently write BISECT_EXPECTED_REV via the refdb (diff) | |
| download | git-dbf668a1b7d814b4fcb57c292934cbbc2d926490.tar.gz git-dbf668a1b7d814b4fcb57c292934cbbc2d926490.zip | |
Merge branch 'ps/pseudo-refs'
Assorted changes around pseudoref handling.
* ps/pseudo-refs:
bisect: consistently write BISECT_EXPECTED_REV via the refdb
refs: complete list of special refs
refs: propagate errno when reading special refs fails
wt-status: read HEAD and ORIG_HEAD via the refdb
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/bisect.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin/bisect.c b/builtin/bisect.c index c5565686bf..47fcce59ff 100644 --- a/builtin/bisect.c +++ b/builtin/bisect.c @@ -17,7 +17,6 @@ #include "revision.h" static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS") -static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV") static GIT_PATH_FUNC(git_path_bisect_ancestors_ok, "BISECT_ANCESTORS_OK") static GIT_PATH_FUNC(git_path_bisect_start, "BISECT_START") static GIT_PATH_FUNC(git_path_bisect_log, "BISECT_LOG") @@ -920,7 +919,6 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, int argc, const char *state; int i, verify_expected = 1; struct object_id oid, expected; - struct strbuf buf = STRBUF_INIT; struct oid_array revs = OID_ARRAY_INIT; if (!argc) @@ -975,10 +973,8 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, int argc, oid_array_append(&revs, &commit->object.oid); } - if (strbuf_read_file(&buf, git_path_bisect_expected_rev(), 0) < the_hash_algo->hexsz || - get_oid_hex(buf.buf, &expected) < 0) + if (read_ref("BISECT_EXPECTED_REV", &expected)) verify_expected = 0; /* Ignore invalid file contents */ - strbuf_release(&buf); for (i = 0; i < revs.nr; i++) { if (bisect_write(state, oid_to_hex(&revs.oid[i]), terms, 0)) { @@ -987,7 +983,7 @@ static enum bisect_error bisect_state(struct bisect_terms *terms, int argc, } if (verify_expected && !oideq(&revs.oid[i], &expected)) { unlink_or_warn(git_path_bisect_ancestors_ok()); - unlink_or_warn(git_path_bisect_expected_rev()); + delete_ref(NULL, "BISECT_EXPECTED_REV", NULL, REF_NO_DEREF); verify_expected = 0; } } |
