Skip to content

Commit 18986d5

Browse files
pcloudsgitster
authored andcommitted
i18n: make warn_dangling_symref() automatically append \n
This helps remove \n from translatable strings Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9665627 commit 18986d5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

builtin/fetch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ static int prune_refs(struct refspec *refs, int ref_count, struct ref *ref_map)
537537
int result = 0;
538538
struct ref *ref, *stale_refs = get_stale_heads(refs, ref_count, ref_map);
539539
const char *dangling_msg = dry_run
540-
? _(" (%s will become dangling)\n")
541-
: _(" (%s has become dangling)\n");
540+
? _(" (%s will become dangling)")
541+
: _(" (%s has become dangling)");
542542

543543
for (ref = stale_refs; ref; ref = ref->next) {
544544
if (!dry_run)

builtin/remote.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,8 +1260,8 @@ static int prune_remote(const char *remote, int dry_run)
12601260
int result = 0, i;
12611261
struct ref_states states;
12621262
const char *dangling_msg = dry_run
1263-
? " %s will become dangling!\n"
1264-
: " %s has become dangling!\n";
1263+
? " %s will become dangling!"
1264+
: " %s has become dangling!";
12651265

12661266
memset(&states, 0, sizeof(states));
12671267
get_remote_ref_states(remote, &states, GET_REF_STATES);

refs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ static int warn_if_dangling_symref(const char *refname, const unsigned char *sha
395395
return 0;
396396

397397
fprintf(d->fp, d->msg_fmt, refname);
398+
fputc('\n', d->fp);
398399
return 0;
399400
}
400401

0 commit comments

Comments
 (0)