@@ -1471,35 +1471,35 @@ char *get_head_description(void)
1471
1471
struct wt_status_state state ;
1472
1472
memset (& state , 0 , sizeof (state ));
1473
1473
wt_status_get_state (the_repository , & state , 1 );
1474
+
1475
+ /*
1476
+ * The ( character must be hard-coded and not part of a localizable
1477
+ * string, since the description is used as a sort key and compared
1478
+ * with ref names.
1479
+ */
1480
+ strbuf_addch (& desc , '(' );
1474
1481
if (state .rebase_in_progress ||
1475
1482
state .rebase_interactive_in_progress ) {
1476
1483
if (state .branch )
1477
- strbuf_addf (& desc , _ ("( no branch, rebasing %s) " ),
1484
+ strbuf_addf (& desc , _ ("no branch, rebasing %s" ),
1478
1485
state .branch );
1479
1486
else
1480
- strbuf_addf (& desc , _ ("( no branch, rebasing detached HEAD %s) " ),
1487
+ strbuf_addf (& desc , _ ("no branch, rebasing detached HEAD %s" ),
1481
1488
state .detached_from );
1482
1489
} else if (state .bisect_in_progress )
1483
- strbuf_addf (& desc , _ ("( no branch, bisect started on %s) " ),
1490
+ strbuf_addf (& desc , _ ("no branch, bisect started on %s" ),
1484
1491
state .branch );
1485
1492
else if (state .detached_from ) {
1486
1493
if (state .detached_at )
1487
- /*
1488
- * TRANSLATORS: make sure this matches "HEAD
1489
- * detached at " in wt-status.c
1490
- */
1491
- strbuf_addf (& desc , _ ("(HEAD detached at %s)" ),
1492
- state .detached_from );
1494
+ strbuf_addstr (& desc , HEAD_DETACHED_AT );
1493
1495
else
1494
- /*
1495
- * TRANSLATORS: make sure this matches "HEAD
1496
- * detached from " in wt-status.c
1497
- */
1498
- strbuf_addf (& desc , _ ("(HEAD detached from %s)" ),
1499
- state .detached_from );
1496
+ strbuf_addstr (& desc , HEAD_DETACHED_FROM );
1497
+ strbuf_addstr (& desc , state .detached_from );
1500
1498
}
1501
1499
else
1502
- strbuf_addstr (& desc , _ ("(no branch)" ));
1500
+ strbuf_addstr (& desc , _ ("no branch" ));
1501
+ strbuf_addch (& desc , ')' );
1502
+
1503
1503
free (state .branch );
1504
1504
free (state .onto );
1505
1505
free (state .detached_from );
0 commit comments