Add space to git-prompt between branch & remote diff

This commit is contained in:
2026-11-12 13:24:28 +00:00
parent a2e95fddb7
commit 8e3e7c3247

View File

@@ -123,8 +123,9 @@ int main() {
remote, "/", branch, "...HEAD --count"));
char count[32] = {};
fread(count, 1, sizeof(count), process.out);
if (process_close(process) == 0 && strcmp("0", trim(count))) {
append(prompt, 2, "↑", trim(count));
int ahead = process_close(process) == 0 && strcmp("0", trim(count));
if (ahead) {
append(prompt, 2, " ↑", trim(count));
}
// get the number of commits behind the remote
@@ -135,7 +136,7 @@ int main() {
memset(count, 0, sizeof(count));
fread(count, 1, sizeof(count), process.out);
if (process_close(process) == 0 && strcmp("0", trim(count))) {
append(prompt, 2, "↓", trim(count));
append(prompt, 2, ahead ? "↓" : " ↓", trim(count));
}
}
append(prompt, 1, " ");