git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] contrib/workdir: create logs/refs and rr-cache in the origin repository

From
Adeodato Simó <dato@net.com.org.es>
Date
Jan 17, 2009, 16:15 UTC
Message-ID
<1232208943-31756-1-git-send-email-dato@net.com.org.es>

If logs/refs or rr-cache are dangling symlinks in the workdir, and reflogs and/or rerere are enabled, commit will die with "fatal: Could not create directory". (In the case of rr-cache, it will die after having created the commit.)

This commit just creates logs/refs and rr-cache in the origin repository if they don't exist already.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
 contrib/workdir/git-new-workdir |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir
index 993cacf..a4e89d0 100755
--- a/contrib/workdir/git-new-workdir
+++ b/contrib/workdir/git-new-workdir
@@ -66,6 +66,12 @@ mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
 for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
 do
 	case $x in
+	logs/refs|rr-cache)
+		if [ ! -e "$git_dir/$x" ]; then
+			mkdir -p "$git_dir/$x"
+		fi
+	esac
+	case $x in
 	*/*)
 		mkdir -p "$(dirname "$new_workdir/.git/$x")"
 		;;
-- 
1.6.1.263.g35eb3c
Next: Junio C Hamano
Message 1 of 6 in “contrib/workdir: create logs/refs and rr-cache in the origin repository”
  1. contrib/workdir: create logs/refs and rr-cache in the origin repositoryAdeodato Simó, Jan 17, 2009
  2. Junio C HamanoJan 18, 2009
  3. Adeodato SimóJan 18, 2009
  4. Junio C HamanoJan 18, 2009
  5. Adeodato SimóJan 19, 2009
  6. Junio C HamanoJan 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.