Thread (295 messages) 295 messages, 13 authors, 2020-07-31

Re: [PATCH v17 12/17] Reftable support for git-core

flat view

From: SZEDER Gábor <hidden>
Date: 2020-06-19 14:24:35

On Tue, Jun 16, 2020 at 07:20:37PM +0000, Han-Wen Nienhuys via GitGitGadget wrote:
quoted hunk ↗ jump to hunk
+static int reftable_init_db(struct ref_store *ref_store, struct strbuf *err)
+{
+	struct git_reftable_ref_store *refs =
+		(struct git_reftable_ref_store *)ref_store;
+	struct strbuf sb = STRBUF_INIT;
+
+	safe_create_dir(refs->reftable_dir, 1);
+
+	strbuf_addf(&sb, "%s/HEAD", refs->repo_dir);
+	write_file(sb.buf, "ref: refs/.invalid");
The "Backward compatibility" section of the specs says:

  * `.git/HEAD`, a regular file containing `ref: refs/heads/.invalid`.

not "refs/.invalid".
quoted hunk ↗ jump to hunk
+	strbuf_reset(&sb);
+
+	strbuf_addf(&sb, "%s/refs", refs->repo_dir);
+	safe_create_dir(sb.buf, 1);
+	strbuf_reset(&sb);
+
+	strbuf_addf(&sb, "%s/refs/heads", refs->repo_dir);
+	write_file(sb.buf, "this repository uses the reftable format");
+
+	return 0;
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help