338
struct recent_command *rc;
339
340
if (!rpt) {
341
- error_errno("can't write crash report %s", loc);
341
+ error_errno(_("can't write crash report %s"), loc);
342
free(loc);
343
return;
344
}
345
346
- fprintf(stderr, "fast-import: dumping crash report to %s\n", loc);
346
+ fprintf(stderr, _("fast-import: dumping crash report to %s\n"), loc);
347
348
fprintf(rpt, "fast-import crash report:\n");
349
fprintf(rpt, " fast-import process: %"PRIuMAX"\n", (uintmax_t) getpid());
587
oe = s->data.marked[idnum];
588
}
589
if (!oe)
590
- die("mark :%" PRIuMAX " not declared", orig_idnum);
590
+ die(_("mark :%" PRIuMAX " not declared"), orig_idnum);
591
return oe;
592
}
593
627
struct branch *b = lookup_branch(name);
628
629
if (b)
630
- die("Invalid attempt to create duplicate branch: %s", name);
630
+ die(_("invalid attempt to create duplicate branch: %s"), name);
631
if (check_refname_format(name, REFNAME_ALLOW_ONELEVEL))
632
- die("Branch name doesn't conform to GIT standards: %s", name);
632
+ die(_("branch name doesn't conform to Git standards: %s"), name);
633
634
b = mem_pool_calloc(&fi_mem_pool, 1, sizeof(struct branch));
635
b->name = mem_pool_strdup(&fi_mem_pool, name);
800
*c++ = &e->idx;
801
last = idx + object_count;
802
if (c != last)
803
- die("internal consistency error creating the index");
803
+ die(_("internal consistency error creating the index"));
804
805
tmpfile = write_idx_file(the_repository, NULL, idx, object_count,
806
&pack_idx_opts, pack_data->hash);
818
keep_fd = safe_create_file_with_leading_directories(pack_data->repo,
819
name.buf);
820
if (keep_fd < 0)
821
- die_errno("cannot create keep file");
821
+ die_errno(_("cannot create keep file"));
822
write_or_die(keep_fd, keep_msg, strlen(keep_msg));
823
if (close(keep_fd))
824
- die_errno("failed to write keep file");
824
+ die_errno(_("failed to write keep file"));
825
826
odb_pack_name(pack_data->repo, &name, pack_data->hash, "pack");
827
if (finalize_object_file(pack_data->repo, pack_data->pack_name, name.buf))
828
- die("cannot store pack file");
828
+ die(_("cannot store pack file"));
829
830
odb_pack_name(pack_data->repo, &name, pack_data->hash, "idx");
831
if (finalize_object_file(pack_data->repo, curr_index_name, name.buf))
832
- die("cannot store index file");
832
+ die(_("cannot store index file"));
833
free((void *)curr_index_name);
834
return strbuf_detach(&name, NULL);
835
}
852
struct child_process unpack = CHILD_PROCESS_INIT;
853
854
if (lseek(p->pack_fd, 0, SEEK_SET) < 0)
855
- die_errno("Failed seeking to start of '%s'", p->pack_name);
855
+ die_errno(_("failed seeking to start of '%s'"), p->pack_name);
856
857
unpack.in = p->pack_fd;
858
unpack.git_cmd = 1;
902
new_p = packfile_store_load_pack(pack_data->repo->objects->packfiles,
903
idx_name, 1);
904
if (!new_p)
905
- die("core git rejected index %s", idx_name);
905
+ die(_("core Git rejected index %s"), idx_name);
906
all_packs[pack_id] = new_p;
907
free(idx_name);
908
1089
static void truncate_pack(struct hashfile_checkpoint *checkpoint)
1090
{
1091
if (hashfile_truncate(pack_file, checkpoint))
1092
- die_errno("cannot truncate pack to skip duplicate");
1092
+ die_errno(_("cannot truncate pack to skip duplicate"));
1093
pack_size = checkpoint->offset;
1094
}
1095
1137
size_t cnt = in_sz < len ? in_sz : (size_t)len;
1138
size_t n = fread(in_buf, 1, cnt, stdin);
1139
if (!n && feof(stdin))
1140
- die("EOF in data (%" PRIuMAX " bytes remaining)", len);
1140
+ die(_("EOF in data (%" PRIuMAX " bytes remaining)"), len);
1141
1142
git_hash_update(&c, in_buf, n);
1143
s.next_in = in_buf;
1161
case Z_STREAM_END:
1162
continue;
1163
default:
1164
- die("unexpected deflate failure: %d", status);
1164
+ die(_("unexpected deflate failure: %d"), status);
1165
}
1166
}
1167
git_deflate_end(&s);
1263
myoe = find_object(oid);
1264
if (myoe && myoe->pack_id != MAX_PACK_ID) {
1265
if (myoe->type != OBJ_TREE)
1266
- die("Not a tree: %s", oid_to_hex(oid));
1266
+ die(_("not a tree: %s"), oid_to_hex(oid));
1267
t->delta_depth = myoe->depth;
1268
buf = gfi_unpack_entry(myoe, &size);
1269
if (!buf)
1270
- die("Can't load tree %s", oid_to_hex(oid));
1270
+ die(_("can't load tree %s"), oid_to_hex(oid));
1271
} else {
1272
enum object_type type;
1273
buf = odb_read_object(the_repository->objects, oid, &type, &size);
1274
if (!buf || type != OBJ_TREE)
1275
- die("Can't load tree %s", oid_to_hex(oid));
1275
+ die(_("can't load tree %s"), oid_to_hex(oid));
1276
}
1277
1278
c = buf;
1286
e->tree = NULL;
1287
c = parse_mode(c, &e->versions[1].mode);
1288
if (!c)
1289
- die("Corrupt mode in %s", oid_to_hex(oid));
1289
+ die(_("corrupt mode in %s"), oid_to_hex(oid));
1290
e->versions[0].mode = e->versions[1].mode;
1291
e->name = to_atom(c, strlen(c));
1292
c += e->name->str_len + 1;
1398
struct tree_content *newtree)
1399
{
1400
if (!S_ISDIR(mode))
1401
- die("Root cannot be a non-directory");
1401
+ die(_("root cannot be a non-directory"));
1402
oidclr(&root->versions[0].oid, the_repository->hash_algo);
1403
oidcpy(&root->versions[1].oid, oid);
1404
if (root->tree)
1421
slash1 = strchrnul(p, '/');
1422
n = slash1 - p;
1423
if (!n)
1424
- die("Empty path component found in input");
1424
+ die(_("empty path component found in input"));
1425
if (!*slash1 && !S_ISDIR(mode) && subtree)
1426
- die("Non-directories cannot have subtrees");
1426
+ die(_("non-directories cannot have subtrees"));
1427
1428
if (!root->tree)
1429
load_tree(root);
1575
slash1 = strchrnul(p, '/');
1576
n = slash1 - p;
1577
if (!n && !allow_root)
1578
- die("Empty path component found in input");
1578
+ die(_("empty path component found in input"));
1579
1580
if (!root->tree)
1581
load_tree(root);
1621
!strcmp(b->name + strlen(replace_prefix),
1622
oid_to_hex(&b->oid))) {
1623
if (!quiet)
1624
- warning("Dropping %s since it would point to "
1625
- "itself (i.e. to %s)",
1624
+ warning(_("dropping %s since it would point to "
1625
+ "itself (i.e. to %s)"),
1626
b->name, oid_to_hex(&b->oid));
1627
refs_delete_ref(get_main_ref_store(the_repository),
1628
NULL, b->name, NULL, 0);
1645
new_cmit = lookup_commit_reference_gently(the_repository,
1646
&b->oid, 0);
1647
if (!old_cmit || !new_cmit)
1648
- return error("Branch %s is missing commits.", b->name);
1648
+ return error(_("branch %s is missing commits."), b->name);
1649
1650
ret = repo_in_merge_bases(the_repository, old_cmit, new_cmit);
1651
if (ret < 0)
1652
exit(128);
1653
if (!ret) {
1654
- warning("Not updating %s"
1655
- " (new tip %s does not contain %s)",
1654
+ warning(_("not updating %s"
1655
+ " (new tip %s does not contain %s)"),
1656
b->name, oid_to_hex(&b->oid),
1657
oid_to_hex(&old_oid));
1658
return -1;
1728
return;
1729
1730
if (safe_create_leading_directories_const(the_repository, export_marks_file)) {
1731
- failure |= error_errno("unable to create leading directories of %s",
1731
+ failure |= error_errno(_("unable to create leading directories of %s"),
1732
export_marks_file);
1733
return;
1734
}
1735
1736
if (hold_lock_file_for_update(&mark_lock, export_marks_file, 0) < 0) {
1737
- failure |= error_errno("Unable to write marks file %s",
1737
+ failure |= error_errno(_("unable to write marks file %s"),
1738
export_marks_file);
1739
return;
1740
}
1743
if (!f) {
1744
int saved_errno = errno;
1745
rollback_lock_file(&mark_lock);
1746
- failure |= error("Unable to write marks file %s: %s",
1746
+ failure |= error(_("unable to write marks file %s: %s"),
1747
export_marks_file, strerror(saved_errno));
1748
return;
1749
}
1750
1751
for_each_mark(marks, 0, dump_marks_fn, f);
1752
if (commit_lock_file(&mark_lock)) {
1753
- failure |= error_errno("Unable to write file %s",
1753
+ failure |= error_errno(_("unable to write file %s"),
1754
export_marks_file);
1755
return;
1756
}
1764
enum object_type type = odb_read_object_info(the_repository->objects,
1765
oid, NULL);
1766
if (type < 0)
1767
- die("object not found: %s", oid_to_hex(oid));
1767
+ die(_("object not found: %s"), oid_to_hex(oid));
1768
e = insert_object(oid);
1769
e->type = type;
1770
e->pack_id = MAX_PACK_ID;
1791
1792
end = strchr(line, '\n');
1793
if (line[0] != ':' || !end)
1794
- die("corrupt mark line: %s", line);
1794
+ die(_("corrupt mark line: %s"), line);
1795
*end = 0;
1796
mark = strtoumax(line + 1, &end, 10);
1797
if (!mark || end == line + 1
1798
|| *end != ' '
1799
|| get_oid_hex_any(end + 1, &oid) == GIT_HASH_UNKNOWN)
1800
- die("corrupt mark line: %s", line);
1800
+ die(_("corrupt mark line: %s"), line);
1801
inserter(s, &oid, mark);
1802
}
1803
}
1810
else if (import_marks_file_ignore_missing && errno == ENOENT)
1811
goto done; /* Marks file does not exist */
1812
else
1813
- die_errno("cannot read '%s'", import_marks_file);
1813
+ die_errno(_("cannot read '%s'"), import_marks_file);
1814
read_mark_file(&marks, f, insert_object_entry);
1815
fclose(f);
1816
done:
1896
strbuf_reset(sb);
1897
1898
if (!skip_prefix(command_buf.buf, "data ", &data))
1899
- die("Expected 'data n' command, found: %s", command_buf.buf);
1899
+ die(_("expected 'data n' command, found: %s"), command_buf.buf);
1900
1901
if (skip_prefix(data, "<<", &data)) {
1902
char *term = xstrdup(data);
1904
1905
for (;;) {
1906
if (strbuf_getline_lf(&command_buf, stdin) == EOF)
1907
- die("EOF in data (terminator '%s' not found)", term);
1907
+ die(_("EOF in data (terminator '%s' not found)"), term);
1908
if (term_len == command_buf.len
1909
&& !strcmp(term, command_buf.buf))
1910
break;
1922
return 0;
1923
}
1924
if (length < len)
1925
- die("data is too large to use in this context");
1925
+ die(_("data is too large to use in this context"));
1926
1927
while (n < length) {
1928
size_t s = strbuf_fread(sb, length - n, stdin);
1929
if (!s && feof(stdin))
1930
- die("EOF in data (%lu bytes remaining)",
1930
+ die(_("EOF in data (%lu bytes remaining)"),
1931
(unsigned long)(length - n));
1932
n += s;
1933
}
1984
1985
ltgt = buf + strcspn(buf, "<>");
1986
if (*ltgt != '<')
1987
- die("Missing < in ident string: %s", buf);
1987
+ die(_("missing < in ident string: %s"), buf);
1988
if (ltgt != buf && ltgt[-1] != ' ')
1989
- die("Missing space before < in ident string: %s", buf);
1989
+ die(_("missing space before < in ident string: %s"), buf);
1990
ltgt = ltgt + 1 + strcspn(ltgt + 1, "<>");
1991
if (*ltgt != '>')
1992
- die("Missing > in ident string: %s", buf);
1992
+ die(_("missing > in ident string: %s"), buf);
1993
ltgt++;
1994
if (*ltgt != ' ')
1995
- die("Missing space after > in ident string: %s", buf);
1995
+ die(_("missing space after > in ident string: %s"), buf);
1996
ltgt++;
1997
name_len = ltgt - buf;
1998
strbuf_add(&ident, buf, name_len);
2000
switch (whenspec) {
2001
case WHENSPEC_RAW:
2002
if (validate_raw_date(ltgt, &ident, 1) < 0)
2003
- die("Invalid raw date \"%s\" in ident: %s", ltgt, buf);
2003
+ die(_("invalid raw date \"%s\" in ident: %s"), ltgt, buf);
2004
break;
2005
case WHENSPEC_RAW_PERMISSIVE:
2006
if (validate_raw_date(ltgt, &ident, 0) < 0)
2007
- die("Invalid raw date \"%s\" in ident: %s", ltgt, buf);
2007
+ die(_("invalid raw date \"%s\" in ident: %s"), ltgt, buf);
2008
break;
2009
case WHENSPEC_RFC2822:
2010
if (parse_date(ltgt, &ident) < 0)
2011
- die("Invalid rfc2822 date \"%s\" in ident: %s", ltgt, buf);
2011
+ die(_("invalid rfc2822 date \"%s\" in ident: %s"), ltgt, buf);
2012
break;
2013
case WHENSPEC_NOW:
2014
if (strcmp("now", ltgt))
2015
- die("Date in ident must be 'now': %s", buf);
2015
+ die(_("date in ident must be 'now': %s"), buf);
2016
datestamp(&ident);
2017
break;
2018
}
2106
{
2107
unsigned int i = 0, j = 0;
2108
if (fanout >= the_hash_algo->rawsz)
2109
- die("Too large fanout (%u)", fanout);
2109
+ die(_("too large fanout (%u)"), fanout);
2110
while (fanout) {
2111
path[i++] = hex_sha1[j++];
2112
path[i++] = hex_sha1[j++];
2180
2181
/* Rename fullpath to realpath */
2182
if (!tree_content_remove(orig_root, fullpath, &leaf, 0))
2183
- die("Failed to remove path %s", fullpath);
2183
+ die(_("failed to remove path %s"), fullpath);
2184
tree_content_set(orig_root, realpath,
2185
&leaf.versions[1].oid,
2186
leaf.versions[1].mode,
2253
p++;
2254
mark = strtoumax(p, endptr, 10);
2255
if (*endptr == p)
2256
- die("No value after ':' in mark: %s", command_buf.buf);
2256
+ die(_("no value after ':' in mark: %s"), command_buf.buf);
2257
return mark;
2258
}
2259
2268
2269
mark = parse_mark_ref(p, &end);
2270
if (*end != '\0')
2271
- die("Garbage after mark: %s", command_buf.buf);
2271
+ die(_("garbage after mark: %s"), command_buf.buf);
2272
return mark;
2273
}
2274
2283
2284
mark = parse_mark_ref(*p, &end);
2285
if (*end++ != ' ')
2286
- die("Missing space after mark: %s", command_buf.buf);
2286
+ die(_("missing space after mark: %s"), command_buf.buf);
2287
*p = end;
2288
return mark;
2289
}
2299
{
2300
if (*p == '"') {
2301
if (unquote_c_style(sb, p, endp))
2302
- die("Invalid %s: %s", field, command_buf.buf);
2302
+ die(_("invalid %s: %s"), field, command_buf.buf);
2303
if (strlen(sb->buf) != sb->len)
2304
- die("NUL in %s: %s", field, command_buf.buf);
2304
+ die(_("NUL in %s: %s"), field, command_buf.buf);
2305
} else {
2306
/*
2307
* Unless we are parsing the last field of a line,
2324
2325
parse_path(sb, p, &end, 1, field);
2326
if (*end)
2327
- die("Garbage after %s: %s", field, command_buf.buf);
2327
+ die(_("garbage after %s: %s"), field, command_buf.buf);
2328
}
2329
2330
/*
2337
{
2338
parse_path(sb, p, endp, 0, field);
2339
if (**endp != ' ')
2340
- die("Missing space after %s: %s", field, command_buf.buf);
2340
+ die(_("missing space after %s: %s"), field, command_buf.buf);
2341
(*endp)++;
2342
}
2343
2350
2351
p = parse_mode(p, &mode);
2352
if (!p)
2353
- die("Corrupt mode: %s", command_buf.buf);
2353
+ die(_("corrupt mode: %s"), command_buf.buf);
2354
switch (mode) {
2355
case 0644:
2356
case 0755:
2363
/* ok */
2364
break;
2365
default:
2366
- die("Corrupt mode: %s", command_buf.buf);
2366
+ die(_("corrupt mode: %s"), command_buf.buf);
2367
}
2368
2369
if (*p == ':') {
2374
oe = NULL; /* not used with inline_data, but makes gcc happy */
2375
} else {
2376
if (parse_mapped_oid_hex(p, &oid, &p))
2377
- die("Invalid dataref: %s", command_buf.buf);
2377
+ die(_("invalid dataref: %s"), command_buf.buf);
2378
oe = find_object(&oid);
2379
if (*p++ != ' ')
2380
- die("Missing space after SHA1: %s", command_buf.buf);
2380
+ die(_("missing space after SHA1: %s"), command_buf.buf);
2381
}
2382
2383
strbuf_reset(&path);
2393
2394
if (S_ISGITLINK(mode)) {
2395
if (inline_data)
2396
- die("Git links cannot be specified 'inline': %s",
2396
+ die(_("Git links cannot be specified 'inline': %s"),
2397
command_buf.buf);
2398
else if (oe) {
2399
if (oe->type != OBJ_COMMIT)
2400
- die("Not a commit (actually a %s): %s",
2400
+ die(_("not a commit (actually a %s): %s"),
2401
type_name(oe->type), command_buf.buf);
2402
}
2403
/*
2406
*/
2407
} else if (inline_data) {
2408
if (S_ISDIR(mode))
2409
- die("Directories cannot be specified 'inline': %s",
2409
+ die(_("directories cannot be specified 'inline': %s"),
2410
command_buf.buf);
2411
while (read_next_command() != EOF) {
2412
const char *v;
2424
odb_read_object_info(the_repository->objects,
2425
&oid, NULL);
2426
if (type < 0)
2427
- die("%s not found: %s",
2428
- S_ISDIR(mode) ? "Tree" : "Blob",
2429
- command_buf.buf);
2427
+ die(_("%s not found: %s"),
2428
+ S_ISDIR(mode) ? _("tree") : _("blob"),
2429
+ command_buf.buf);
2430
if (type != expected)
2431
- die("Not a %s (actually a %s): %s",
2431
+ die(_("not a %s (actually a %s): %s"),
2432
type_name(expected), type_name(type),
2433
command_buf.buf);
2434
}
2439
}
2440
2441
if (!verify_path(path.buf, mode))
2442
- die("invalid path '%s'", path.buf);
2442
+ die(_("invalid path '%s'"), path.buf);
2443
tree_content_set(&b->branch_tree, path.buf, &oid, mode, NULL);
2444
}
2445
2469
else
2470
tree_content_get(&b->branch_tree, source.buf, &leaf, 1);
2471
if (!leaf.versions[1].mode)
2472
- die("Path %s not in branch", source.buf);
2472
+ die(_("path %s not in branch"), source.buf);
2473
if (!*dest.buf) { /* C "path/to/subdir" "" */
2474
tree_content_replace(&b->branch_tree,
2475
&leaf.versions[1].oid,
2478
return;
2479
}
2480
if (!verify_path(dest.buf, leaf.versions[1].mode))
2481
- die("invalid path '%s'", dest.buf);
2481
+ die(_("invalid path '%s'"), dest.buf);
2482
tree_content_set(&b->branch_tree, dest.buf,
2483
&leaf.versions[1].oid,
2484
leaf.versions[1].mode,
2520
oe = NULL; /* not used with inline_data, but makes gcc happy */
2521
} else {
2522
if (parse_mapped_oid_hex(p, &oid, &p))
2523
- die("Invalid dataref: %s", command_buf.buf);
2523
+ die(_("invalid dataref: %s"), command_buf.buf);
2524
oe = find_object(&oid);
2525
if (*p++ != ' ')
2526
- die("Missing space after SHA1: %s", command_buf.buf);
2526
+ die(_("missing space after SHA1: %s"), command_buf.buf);
2527
}
2528
2529
/* <commit-ish> */
2530
s = lookup_branch(p);
2531
if (s) {
2532
if (is_null_oid(&s->oid))
2533
- die("Can't add a note on empty branch.");
2533
+ die(_("can't add a note on empty branch."));
2534
oidcpy(&commit_oid, &s->oid);
2535
} else if (*p == ':') {
2536
uintmax_t commit_mark = parse_mark_ref_eol(p);
2537
struct object_entry *commit_oe = find_mark(marks, commit_mark);
2538
if (commit_oe->type != OBJ_COMMIT)
2539
- die("Mark :%" PRIuMAX " not a commit", commit_mark);
2539
+ die(_("mark :%" PRIuMAX " not a commit"), commit_mark);
2540
oidcpy(&commit_oid, &commit_oe->idx.oid);
2541
} else if (!repo_get_oid(the_repository, p, &commit_oid)) {
2542
unsigned long size;
2544
&commit_oid, OBJ_COMMIT, &size,
2545
&commit_oid);
2546
if (!buf || size < the_hash_algo->hexsz + 6)
2547
- die("Not a valid commit: %s", p);
2547
+ die(_("not a valid commit: %s"), p);
2548
free(buf);
2549
} else
2550
- die("Invalid ref name or SHA1 expression: %s", p);
2550
+ die(_("invalid ref name or SHA1 expression: %s"), p);
2551
2552
if (inline_data) {
2553
read_next_command();
2554
parse_and_store_blob(&last_blob, &oid, 0);
2555
} else if (oe) {
2556
if (oe->type != OBJ_BLOB)
2557
- die("Not a blob (actually a %s): %s",
2557
+ die(_("not a blob (actually a %s): %s"),
2558
type_name(oe->type), command_buf.buf);
2559
} else if (!is_null_oid(&oid)) {
2560
enum object_type type = odb_read_object_info(the_repository->objects, &oid,
2561
NULL);
2562
if (type < 0)
2563
- die("Blob not found: %s", command_buf.buf);
2563
+ die(_("blob not found: %s"), command_buf.buf);
2564
if (type != OBJ_BLOB)
2565
- die("Not a blob (actually a %s): %s",
2565
+ die(_("not a blob (actually a %s): %s"),
2566
type_name(type), command_buf.buf);
2567
}
2568
2591
static void parse_from_commit(struct branch *b, char *buf, unsigned long size)
2592
{
2593
if (!buf || size < the_hash_algo->hexsz + 6)
2594
- die("Not a valid commit: %s", oid_to_hex(&b->oid));
2594
+ die(_("not a valid commit: %s"), oid_to_hex(&b->oid));
2595
if (memcmp("tree ", buf, 5)
2596
|| get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid))
2597
- die("The commit %s is corrupt", oid_to_hex(&b->oid));
2597
+ die(_("the commit %s is corrupt"), oid_to_hex(&b->oid));
2598
oidcpy(&b->branch_tree.versions[0].oid,
2599
&b->branch_tree.versions[1].oid);
2600
}
2624
2625
s = lookup_branch(objectish);
2626
if (b == s)
2627
- die("Can't create a branch from itself: %s", b->name);
2627
+ die(_("can't create a branch from itself: %s"), b->name);
2628
else if (s) {
2629
struct object_id *t = &s->branch_tree.versions[1].oid;
2630
oidcpy(&b->oid, &s->oid);
2634
uintmax_t idnum = parse_mark_ref_eol(objectish);
2635
struct object_entry *oe = find_mark(marks, idnum);
2636
if (oe->type != OBJ_COMMIT)
2637
- die("Mark :%" PRIuMAX " not a commit", idnum);
2637
+ die(_("mark :%" PRIuMAX " not a commit"), idnum);
2638
if (!oideq(&b->oid, &oe->idx.oid)) {
2639
oidcpy(&b->oid, &oe->idx.oid);
2640
if (oe->pack_id != MAX_PACK_ID) {
2651
b->delete = 1;
2652
}
2653
else
2654
- die("Invalid ref name or SHA1 expression: %s", objectish);
2654
+ die(_("invalid ref name or SHA1 expression: %s"), objectish);
2655
2656
if (b->branch_tree.tree && !oideq(&oid, &b->branch_tree.versions[1].oid)) {
2657
release_tree_content_recursive(b->branch_tree.tree);
2698
uintmax_t idnum = parse_mark_ref_eol(from);
2699
struct object_entry *oe = find_mark(marks, idnum);
2700
if (oe->type != OBJ_COMMIT)
2701
- die("Mark :%" PRIuMAX " not a commit", idnum);
2701
+ die(_("mark :%" PRIuMAX " not a commit"), idnum);
2702
oidcpy(&n->oid, &oe->idx.oid);
2703
} else if (!repo_get_oid(the_repository, from, &n->oid)) {
2704
unsigned long size;
2706
&n->oid, OBJ_COMMIT,
2707
&size, &n->oid);
2708
if (!buf || size < the_hash_algo->hexsz + 6)
2709
- die("Not a valid commit: %s", from);
2709
+ die(_("not a valid commit: %s"), from);
2710
free(buf);
2711
} else
2712
- die("Invalid ref name or SHA1 expression: %s", from);
2712
+ die(_("invalid ref name or SHA1 expression: %s"), from);
2713
2714
n->next = NULL;
2715
*tail = n;
2733
char *space = strchr(args, ' ');
2734
2735
if (!space)
2736
- die("Expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', "
2737
- "got 'gpgsig %s'", args);
2736
+ die(_("expected gpgsig format: 'gpgsig <hash-algo> <signature-format>', "
2737
+ "got 'gpgsig %s'"), args);
2738
*space = '\0';
2739
2740
sig->hash_algo = args;
2743
/* Validate hash algorithm */
2744
if (strcmp(sig->hash_algo, "sha1") &&
2745
strcmp(sig->hash_algo, "sha256"))
2746
- die("Unknown git hash algorithm in gpgsig: '%s'", sig->hash_algo);
2746
+ die(_("unknown git hash algorithm in gpgsig: '%s'"), sig->hash_algo);
2747
2748
/* Validate signature format */
2749
if (!valid_signature_format(sig->sig_format))
2750
- die("Invalid signature format in gpgsig: '%s'", sig->sig_format);
2750
+ die(_("invalid signature format in gpgsig: '%s'"), sig->sig_format);
2751
if (!strcmp(sig->sig_format, "unknown"))
2752
- warning("'unknown' signature format in gpgsig");
2752
+ warning(_("'unknown' signature format in gpgsig"));
2753
2754
/* Read signature data */
2755
read_next_command();
2788
const char *hash_type)
2789
{
2790
if (stored_sig->hash_algo) {
2791
- warning("multiple %s signatures found, "
2792
- "ignoring additional signature",
2791
+ warning(_("multiple %s signatures found, "
2792
+ "ignoring additional signature"),
2793
hash_type);
2794
strbuf_release(&new_sig->data);
2795
free(new_sig->hash_algo);
2844
read_next_command();
2845
}
2846
if (!committer)
2847
- die("Expected committer but didn't get one");
2847
+ die(_("expected committer but didn't get one"));
2848
2849
while (skip_prefix(command_buf.buf, "gpgsig ", &v)) {
2850
switch (signed_commit_mode) {
2851
2852
/* First, modes that don't need the signature to be parsed */
2853
case SIGN_ABORT:
2854
- die("encountered signed commit; use "
2855
- "--signed-commits=<mode> to handle it");
2854
+ die(_("encountered signed commit; use "
2855
+ "--signed-commits=<mode> to handle it"));
2856
case SIGN_WARN_STRIP:
2857
warning(_("stripping a commit signature"));
2858
/* fallthru */
2987
2988
/* from ... */
2989
if (!skip_prefix(command_buf.buf, "from ", &from))
2990
- die("Expected from command, got %s", command_buf.buf);
2990
+ die(_("expected 'from' command, got '%s'"), command_buf.buf);
2991
s = lookup_branch(from);
2992
if (s) {
2993
if (is_null_oid(&s->oid))
2994
- die("Can't tag an empty branch.");
2994
+ die(_("can't tag an empty branch."));
2995
oidcpy(&oid, &s->oid);
2996
type = OBJ_COMMIT;
2997
} else if (*from == ':') {
3006
type = odb_read_object_info(the_repository->objects,
3007
&oid, NULL);
3008
if (type < 0)
3009
- die("Not a valid object: %s", from);
3009
+ die(_("not a valid object: %s"), from);
3010
} else
3011
type = oe->type;
3012
} else
3013
- die("Invalid ref name or SHA1 expression: %s", from);
3013
+ die(_("invalid ref name or SHA1 expression: %s"), from);
3014
read_next_command();
3015
3016
/* original-oid ... */
3099
static void cat_blob_write(const char *buf, unsigned long size)
3100
{
3101
if (write_in_full(cat_blob_fd, buf, size) < 0)
3102
- die_errno("Write to frontend failed");
3102
+ die_errno(_("write to frontend failed"));
3103
}
3104
3105
static void cat_blob(struct object_entry *oe, struct object_id *oid)
3128
return;
3129
}
3130
if (!buf)
3131
- die("Can't read object %s", oid_to_hex(oid));
3131
+ die(_("can't read object %s"), oid_to_hex(oid));
3132
if (type != OBJ_BLOB)
3133
- die("Object %s is a %s but a blob was expected.",
3133
+ die(_("object %s is a %s but a blob was expected."),
3134
oid_to_hex(oid), type_name(type));
3135
strbuf_reset(&line);
3136
strbuf_addf(&line, "%s %s %"PRIuMAX"\n", oid_to_hex(oid),
3154
3155
/* get-mark SP <object> LF */
3156
if (*p != ':')
3157
- die("Not a mark: %s", p);
3157
+ die(_("not a mark: %s"), p);
3158
3159
oe = find_mark(marks, parse_mark_ref_eol(p));
3160
if (!oe)
3161
- die("Unknown mark: %s", command_buf.buf);
3161
+ die(_("unknown mark: %s"), command_buf.buf);
3162
3163
xsnprintf(output, sizeof(output), "%s\n", oid_to_hex(&oe->idx.oid));
3164
cat_blob_write(output, the_hash_algo->hexsz + 1);
3173
if (*p == ':') {
3174
oe = find_mark(marks, parse_mark_ref_eol(p));
3175
if (!oe)
3176
- die("Unknown mark: %s", command_buf.buf);
3176
+ die(_("unknown mark: %s"), command_buf.buf);
3177
oidcpy(&oid, &oe->idx.oid);
3178
} else {
3179
if (parse_mapped_oid_hex(p, &oid, &p))
3180
- die("Invalid dataref: %s", command_buf.buf);
3180
+ die(_("invalid dataref: %s"), command_buf.buf);
3181
if (*p)
3182
- die("Garbage after SHA1: %s", command_buf.buf);
3182
+ die(_("garbage after SHA1: %s"), command_buf.buf);
3183
oe = find_object(&oid);
3184
}
3185
3197
enum object_type type = odb_read_object_info(the_repository->objects,
3198
oid, NULL);
3199
if (type < 0)
3200
- die("object not found: %s", oid_to_hex(oid));
3200
+ die(_("object not found: %s"), oid_to_hex(oid));
3201
/* cache it! */
3202
oe = insert_object(oid);
3203
oe->type = type;
3211
case OBJ_TAG:
3212
break;
3213
default:
3214
- die("Not a tree-ish: %s", command_buf.buf);
3214
+ die(_("not a tree-ish: %s"), command_buf.buf);
3215
}
3216
3217
if (oe->pack_id != MAX_PACK_ID) { /* in a pack being written */
3222
&unused, &size);
3223
}
3224
if (!buf)
3225
- die("Can't load object %s", oid_to_hex(oid));
3225
+ die(_("can't load object %s"), oid_to_hex(oid));
3226
3227
/* Peel one layer. */
3228
switch (oe->type) {
3229
case OBJ_TAG:
3230
if (size < hexsz + strlen("object ") ||
3231
get_oid_hex(buf + strlen("object "), oid))
3232
- die("Invalid SHA1 in tag: %s", command_buf.buf);
3232
+ die(_("invalid SHA1 in tag: %s"), command_buf.buf);
3233
break;
3234
case OBJ_COMMIT:
3235
if (size < hexsz + strlen("tree ") ||
3236
get_oid_hex(buf + strlen("tree "), oid))
3237
- die("Invalid SHA1 in commit: %s", command_buf.buf);
3237
+ die(_("invalid SHA1 in commit: %s"), command_buf.buf);
3238
}
3239
3240
free(buf);
3269
for_each_string_list_item(fromp, from) {
3270
top = string_list_lookup(to, fromp->string);
3271
if (!fromp->util) {
3272
- die(_("Missing from marks for submodule '%s'"), fromp->string);
3272
+ die(_("missing from marks for submodule '%s'"), fromp->string);
3273
} else if (!top || !top->util) {
3274
- die(_("Missing to marks for submodule '%s'"), fromp->string);
3274
+ die(_("missing to marks for submodule '%s'"), fromp->string);
3275
}
3276
build_mark_map_one(fromp->util, top->util);
3277
}
3285
if (**p == ':') { /* <mark> */
3286
e = find_mark(marks, parse_mark_ref_space(p));
3287
if (!e)
3288
- die("Unknown mark: %s", command_buf.buf);
3288
+ die(_("unknown mark: %s"), command_buf.buf);
3289
oidcpy(&oid, &e->idx.oid);
3290
} else { /* <sha1> */
3291
if (parse_mapped_oid_hex(*p, &oid, p))
3292
- die("Invalid dataref: %s", command_buf.buf);
3292
+ die(_("invalid dataref: %s"), command_buf.buf);
3293
e = find_object(&oid);
3294
if (*(*p)++ != ' ')
3295
- die("Missing space after tree-ish: %s", command_buf.buf);
3295
+ die(_("missing space after tree-ish: %s"), command_buf.buf);
3296
}
3297
3298
while (!e || e->type != OBJ_TREE)
3336
/* ls SP (<tree-ish> SP)? <path> */
3337
if (*p == '"') {
3338
if (!b)
3339
- die("Not in a commit: %s", command_buf.buf);
3339
+ die(_("not in a commit: %s"), command_buf.buf);
3340
root = &b->branch_tree;
3341
} else {
3342
struct object_entry *e = parse_treeish_dataref(&p);
3399
/* mark ... */
3400
parse_mark();
3401
if (!next_mark)
3402
- die(_("Expected 'mark' command, got %s"), command_buf.buf);
3402
+ die(_("expected 'mark' command, got %s"), command_buf.buf);
3403
3404
/* to ... */
3405
memset(&b, 0, sizeof(b));
3406
if (!parse_objectish_with_prefix(&b, "to "))
3407
- die(_("Expected 'to' command, got %s"), command_buf.buf);
3407
+ die(_("expected 'to' command, got %s"), command_buf.buf);
3408
e = find_object(&b.oid);
3409
assert(e);
3410
insert_mark(&marks, next_mark, e);
3422
{
3423
if (import_marks_file) {
3424
if (from_stream)
3425
- die("Only one import-marks command allowed per stream");
3425
+ die(_("only one import-marks command allowed per stream"));
3426
3427
/* read previous mark file */
3428
if(!import_marks_file_from_stream)
3446
else if (!strcmp(fmt, "now"))
3447
whenspec = WHENSPEC_NOW;
3448
else
3449
- die("unknown --date-format argument %s", fmt);
3449
+ die(_("unknown --date-format argument %s"), fmt);
3450
}
3451
3452
static unsigned long ulong_arg(const char *option, const char *arg)
3454
char *endptr;
3455
unsigned long rv = strtoul(arg, &endptr, 0);
3456
if (strchr(arg, '-') || endptr == arg || *endptr)
3457
- die("%s: argument must be a non-negative integer", option);
3457
+ die(_("%s: argument must be a non-negative integer"), option);
3458
return rv;
3459
}
3460
3462
{
3463
max_depth = ulong_arg("--depth", depth);
3464
if (max_depth > MAX_DEPTH)
3465
- die("--depth cannot exceed %u", MAX_DEPTH);
3465
+ die(_("--depth cannot exceed %u"), MAX_DEPTH);
3466
}
3467
3468
static void option_active_branches(const char *branches)
3480
{
3481
unsigned long n = ulong_arg("--cat-blob-fd", fd);
3482
if (n > (unsigned long) INT_MAX)
3483
- die("--cat-blob-fd cannot exceed %d", INT_MAX);
3483
+ die(_("--cat-blob-fd cannot exceed %d"), INT_MAX);
3484
cat_blob_fd = (int) n;
3485
}
3486
3500
char *s = xstrdup(arg);
3501
char *f = strchr(s, ':');
3502
if (!f)
3503
- die(_("Expected format name:filename for submodule rewrite option"));
3503
+ die(_("expected format name:filename for submodule rewrite option"));
3504
*f = '\0';
3505
f++;
3506
CALLOC_ARRAY(ms, 1);
3508
f = prefix_filename(global_prefix, f);
3509
fp = fopen(f, "r");
3510
if (!fp)
3511
- die_errno("cannot read '%s'", f);
3511
+ die_errno(_("cannot read '%s'"), f);
3512
read_mark_file(&ms, fp, insert_oid_entry);
3513
fclose(fp);
3514
free(f);
3525
if (!git_parse_ulong(option, &v))
3526
return 0;
3527
if (v < 8192) {
3528
- warning("max-pack-size is now in bytes, assuming --max-pack-size=%lum", v);
3528
+ warning(_("max-pack-size is now in bytes, assuming --max-pack-size=%lum"), v);
3529
v *= 1024 * 1024;
3530
} else if (v < 1024 * 1024) {
3531
- warning("minimum max-pack-size is 1 MiB");
3531
+ warning(_("minimum max-pack-size is 1 MiB"));
3532
v = 1024 * 1024;
3533
}
3534
max_packsize = v;
3612
static void parse_feature(const char *feature)
3613
{
3614
if (seen_data_command)
3615
- die("Got feature command '%s' after data command", feature);
3615
+ die(_("got feature command '%s' after data command"), feature);
3616
3617
if (parse_one_feature(feature, 1))
3618
return;
3619
3620
- die("This version of fast-import does not support feature %s.", feature);
3620
+ die(_("this version of fast-import does not support feature %s."), feature);
3621
}
3622
3623
static void parse_option(const char *option)
3624
{
3625
if (seen_data_command)
3626
- die("Got option command '%s' after data command", option);
3626
+ die(_("got option command '%s' after data command"), option);
3627
3628
if (parse_one_option(option))
3629
return;
3630
3631
- die("This version of fast-import does not support option: %s", option);
3631
+ die(_("this version of fast-import does not support option: %s"), option);
3632
}
3633
3634
static void git_pack_config(void)
3672
break;
3673
3674
if (!skip_prefix(a, "--", &a))
3675
- die("unknown option %s", a);
3675
+ die(_("unknown option %s"), a);
3676
3677
if (parse_one_option(a))
3678
continue;
3685
continue;
3686
}
3687
3688
- die("unknown option --%s", a);
3688
+ die(_("unknown option --%s"), a);
3689
}
3690
if (i != global_argc)
3691
usage(fast_import_usage);
3774
else if (starts_with(command_buf.buf, "option "))
3775
/* ignore non-git options*/;
3776
else
3777
- die("Unsupported command: %s", command_buf.buf);
3777
+ die(_("unsupported command: %s"), command_buf.buf);
3778
3779
if (checkpoint_requested)
3780
checkpoint();
3785
parse_argv();
3786
3787
if (require_explicit_termination && feof(stdin))
3788
- die("stream ends early");
3788
+ die(_("stream ends early"));
3789
3790
end_packfile();
3791