chore(3p/sources): Bump channels & overlays

* //3p/sources: switch stable channel from 21.11 (!) to 23.05

* //users: adapt to emacsUnstable to emacs-unstable rename

* //users/grfn: use default Linux kernel version everywhere,
  as 5.15 has broken in this version of nixos-unstable.

* //3p/cgit: adapt to git 2.41.0

  The committed changes are the same as the [patch1] I've submitted
  to cgit-pink which is in turn based on Christian Hesse's [patch2].

patch1: https://causal.agency/list/thread/20230624144033.802270-1-sternenseemann%40systemli.org.html#20230624144033.802270-2-sternenseemann@systemli.org>
patch2: https://lists.zx2c4.com/pipermail/cgit/2023-June/004843.html

Co-authored-by: Christian Hesse <mail@eworm.de>

Change-Id: I549a62e7c85c66d772edda997819a40f2d5835d7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8855
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
sterni 2023-06-23 15:02:41 +02:00 committed by clbot
parent d356f94ef1
commit 12b979e41b
24 changed files with 102 additions and 93 deletions

View file

@ -241,7 +241,7 @@ static int load_mmfile(mmfile_t *file, const struct object_id *oid)
file->ptr = (char *)"";
file->size = 0;
} else {
file->ptr = read_object_file(oid, &type,
file->ptr = repo_read_object_file(the_repository, oid, &type,
(unsigned long *)&file->size);
}
return 1;
@ -343,7 +343,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
struct diff_options opt;
struct pathspec_item *item;
diff_setup(&opt);
repo_diff_setup(the_repository, &opt);
opt.output_format = DIFF_FORMAT_CALLBACK;
opt.detect_rename = 1;
opt.rename_limit = ctx.cfg.renamelimit;
@ -539,7 +539,9 @@ char *expand_macros(const char *txt)
char *get_mimetype_for_filename(const char *filename)
{
char *ext, *mimetype, *token, line[1024], *saveptr;
char *ext, *mimetype, line[1024];
struct string_list list = STRING_LIST_INIT_NODUP;
int i;
FILE *file;
struct string_list_item *mime;
@ -564,13 +566,16 @@ char *get_mimetype_for_filename(const char *filename)
while (fgets(line, sizeof(line), file)) {
if (!line[0] || line[0] == '#')
continue;
mimetype = strtok_r(line, " \t\r\n", &saveptr);
while ((token = strtok_r(NULL, " \t\r\n", &saveptr))) {
if (!strcasecmp(ext, token)) {
string_list_split_in_place(&list, line, " \t\r\n", -1);
string_list_remove_empty_items(&list, 0);
mimetype = list.items[0].string;
for (i = 1; i < list.nr; i++) {
if (!strcasecmp(ext, list.items[i].string)) {
fclose(file);
return xstrdup(mimetype);
}
}
string_list_clear(&list, 0);
}
fclose(file);
return NULL;