Skip to content

Commit 2c050e0

Browse files
avargitster
authored andcommitted
i18n: mark init-db messages for translation
Mark the init-db messages that were added in v1.7.5-rc1~16^2 (init, clone: support --separate-git-dir for .git file) by Nguyễn Thái Ngọc Duy for translation. This requires splitting up the tests that the patch added so that certain parts of them can be skipped unless the C_LOCALE_OUTPUT prerequisite is satisfied. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f06f08b commit 2c050e0

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

builtin/init-db.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ int set_git_dir_init(const char *git_dir, const char *real_git_dir,
319319
struct stat st;
320320

321321
if (!exist_ok && !stat(git_dir, &st))
322-
die("%s already exists", git_dir);
322+
die(_("%s already exists"), git_dir);
323323

324324
if (!exist_ok && !stat(real_git_dir, &st))
325-
die("%s already exists", real_git_dir);
325+
die(_("%s already exists"), real_git_dir);
326326

327327
/*
328328
* make sure symlinks are resolved because we'll be
@@ -351,15 +351,15 @@ static void separate_git_dir(const char *git_dir)
351351
else if (S_ISDIR(st.st_mode))
352352
src = git_link;
353353
else
354-
die("unable to handle file type %d", st.st_mode);
354+
die(_("unable to handle file type %d"), st.st_mode);
355355

356356
if (rename(src, git_dir))
357-
die_errno("unable to move %s to %s", src, git_dir);
357+
die_errno(_("unable to move %s to %s"), src, git_dir);
358358
}
359359

360360
fp = fopen(git_link, "w");
361361
if (!fp)
362-
die("Could not create git link %s", git_link);
362+
die(_("Could not create git link %s"), git_link);
363363
fprintf(fp, "gitdir: %s\n", git_dir);
364364
fclose(fp);
365365
}

t/t5601-clone.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,14 @@ test_expect_success 'do not respect url-encoding of non-url path' '
194194
test_expect_success 'clone separate gitdir' '
195195
rm -rf dst &&
196196
git clone --separate-git-dir realgitdir src dst &&
197-
echo "gitdir: `pwd`/realgitdir" >expected &&
198-
test_cmp expected dst/.git &&
199197
test -d realgitdir/refs
200198
'
201199

200+
test_expect_success C_LOCALE_OUTPUT 'clone separate gitdir: output' '
201+
echo "gitdir: `pwd`/realgitdir" >expected &&
202+
test_cmp expected dst/.git
203+
'
204+
202205
test_expect_success 'clone separate gitdir where target already exists' '
203206
rm -rf dst &&
204207
test_must_fail git clone --separate-git-dir realgitdir src dst

0 commit comments

Comments
 (0)