We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4083c2f commit bda324cCopy full SHA for bda324c
wt-status.c
@@ -288,9 +288,18 @@ void wt_status_print(struct wt_status *s)
288
unsigned char sha1[20];
289
s->is_initial = get_sha1(s->reference, sha1) ? 1 : 0;
290
291
- if (s->branch)
+ if (s->branch) {
292
+ const char *on_what = "On branch ";
293
+ const char *branch_name = s->branch;
294
+ if (!strncmp(branch_name, "refs/heads/", 11))
295
+ branch_name += 11;
296
+ else if (!strcmp(branch_name, "HEAD")) {
297
+ branch_name = "";
298
+ on_what = "Not currently on any branch.";
299
+ }
300
color_printf_ln(color(WT_STATUS_HEADER),
- "# On branch %s", s->branch);
301
+ "# %s%s", on_what, branch_name);
302
303
304
if (s->is_initial) {
305
color_printf_ln(color(WT_STATUS_HEADER), "#");
0 commit comments