Skip to content

Commit 3cbefe2

Browse files
committed
fix(status): emit verbose git object when git context resolves
cbm_git_context_resolve returns 0 on success, but execute_status treated its result as a boolean, so status --verbose only entered the git branch when resolution failed (and then is_git was unset). The git object was therefore never emitted. Compare against 0 like the other callers (http_server.c, pipeline.c). Found while porting upstream DeusData#1561.
1 parent 0dccc26 commit 3cbefe2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/operations/read.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ static cbm_operation_result_t execute_status(const char *args_json,
751751
yyjson_mut_obj_add_strcpy(doc, root, "indexed_at", info.indexed_at ? info.indexed_at : "");
752752
if (verbose && root_path[0]) {
753753
cbm_git_context_t git = {0};
754-
if (cbm_git_context_resolve(root_path, &git) && git.is_git) {
754+
if (cbm_git_context_resolve(root_path, &git) == 0 && git.is_git) {
755755
yyjson_mut_val *git_obj = yyjson_mut_obj(doc);
756756
if (git.branch)
757757
yyjson_mut_obj_add_strcpy(doc, git_obj, "branch", git.branch);

0 commit comments

Comments
 (0)