diff --git a/git-prompt.c b/git-prompt.c index 5d8335e..5c3824a 100644 --- a/git-prompt.c +++ b/git-prompt.c @@ -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, " ");