From b0a2f2fac21d6c88ed7958a7118f833bd90442d4 Mon Sep 17 00:00:00 2001
From: Suzanne Soy
Date: Thu, 24 Jun 2021 00:54:11 +0100
Subject: [PATCH] Removed horizontal scrolling for all code blocks
---
index.html | 61 +++++++++++++++++++++++++++++++++++-------------------
1 file changed, 40 insertions(+), 21 deletions(-)
diff --git a/index.html b/index.html
index 3560246..47767d8 100644
--- a/index.html
+++ b/index.html
@@ -956,11 +956,21 @@ function git_commit(file_paths, message) {
var parent = git_rev_parse('HEAD');
var parents = parent ? [parent] : []
+ var author = {
+ name: gitconfig.user.name,
+ email: gitconfig.user.email,
+ date: now,
+ timezoneMinutes:timezoneMinutes
+ };
+ // the date would be different from the author's e.g. for a git commit --amend,
+ // and the name and e-mail would be different e.g. for a git rebase
+ var committer = author;
+
var new_commit_hash = store_commit(
paths_to_tree(file_paths),
parents,
- {name:gitconfig.user.name, email:gitconfig.user.email, date:now, timezoneMinutes:timezoneMinutes },
- {name:gitconfig.user.name, email:gitconfig.user.email, date:now, timezoneMinutes:timezoneMinutes },
+ author,
+ committer,
message || $EDITOR());
advance_head_or_branch(new_commit_hash);
@@ -977,11 +987,12 @@ function advance_head_or_branch(new_commit_hash) {
var referenced_branch = git_symbolic_ref('HEAD');
if (referenced_branch) {
// Update the target of the ref:
- write(join_paths(current_directory, '.git/' + referenced_branch), new_commit_hash + '\n');
+ var path = join_paths(current_directory, '.git/' + referenced_branch)
} else {
// Detached HEAD, update .git/HEAD directly.
- write(join_paths(current_directory, '.git/HEAD'), new_commit_hash + '\n');
+ var path = join_paths(current_directory, '.git/HEAD');
}
+ write(path, new_commit_hash + '\n');
}
@@ -1019,11 +1030,12 @@ var second_commit = git_commit(['README', 'src/main.scm'], 'Some updates');
function git_tag(tag_name, commit_hash, force) {
mkdir(join_paths(current_directory, '.git/refs'));
mkdir(join_paths(current_directory, '.git/refs/tags'));
- if (!force && exists(join_paths(current_directory, '.git/refs/tags/' + tag_name))) {
+ var tag_path = join_paths(current_directory, '.git/refs/tags/' + tag_name);
+ if (!force && exists(tag_path)) {
alert("tag already exists");
return false;
} else {
- write(join_paths(current_directory, '.git/refs/tags/' + tag_name), commit_hash + '\n');
+ write(tag_path, commit_hash + '\n');
return true;
}
}
@@ -1058,12 +1070,14 @@ git_tag('v1.0', second_commit);