Skip to content

Guard against empty git output to prevent invalid hash#4

Merged
fabriziosalmi merged 1 commit into
fabriziosalmi:masterfrom
fabgpt-coder:fabgpt/quality-6d094e62
Jun 6, 2026
Merged

Guard against empty git output to prevent invalid hash#4
fabriziosalmi merged 1 commit into
fabriziosalmi:masterfrom
fabgpt-coder:fabgpt/quality-6d094e62

Conversation

@fabgpt-coder

Copy link
Copy Markdown
Contributor

FabGPT — code quality

File: build.rs

Rationale: The current logic uses trim() on the git output, which will result in an empty string if the git command fails or returns no output (e.g., in a fresh repo with no commits). This causes the binary version to be 'unknown' instead of a valid fallback, potentially breaking version parsing logic in the application. Adding an explicit check for empty strings ensures the fallback 'unknown' is only used when no hash data exists.

Proposed by FabGPT OS and approved by a human before opening.


🤖 FabGPT OS · source quality · model qwen/qwen3.5-9b · task f345b090f19623f1 · HITL-approved before opening.

The current logic uses `trim()` on the git output, which will result in an empty string if the git command fails or returns no output (e.g., in a fresh repo with no commits). This causes the binary version to be 'unknown' instead of a valid fallback, potentially breaking version parsing logic in the application. Adding an explicit check for empty strings ensures the fallback 'unknown' is only used when no hash data exists.
@fabriziosalmi fabriziosalmi merged commit 5cfb7bb into fabriziosalmi:master Jun 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants