From 324651328162bc248d53c5d5a9c99dc2ea1767d3 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 23 Nov 2020 13:18:49 -0700 Subject: [PATCH] clone/update: include replace refs in clean mirrors Although replace refs (see `git help replace`) may not be commonly used, they can be shared and should any of the "clean" refs use them, they need to be included. Include the refs/replace/* namespace in the set of "clean refs" when configuring a "clean" mirror. As it's nontrivial to limit the replace refs to only those that are actually used by the other "clean refs", this could end up cloning extra stuff that is not logically part of a "clean" mirror. This seems like a better solution than leaving them out since that could result in a logically broken repository. Signed-off-by: Kyle J. McKay --- jobd/update.sh | 2 ++ taskd/clone.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/jobd/update.sh b/jobd/update.sh index de4ba13..8fb7fc5 100755 --- a/jobd/update.sh +++ b/jobd/update.sh @@ -536,6 +536,7 @@ case "$url" in git config --add remote.origin.fetch "+refs/tags/*:refs/tags/*" git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*" git config --add remote.origin.fetch "+refs/top-bases/*:refs/top-bases/*" + git config --add remote.origin.fetch "+refs/replace/*:refs/replace/*" else git config --replace-all remote.origin.fetch "+refs/*:refs/*" fi @@ -616,6 +617,7 @@ case "$url" in -e '/^refs\/tags\//d' \ -e '/^refs\/notes\//d' \ -e '/^refs\/top-bases\//d' \ + -e '/^refs\/replace\//d' \ -e 's/^/delete /' | git_updateref_stdin fi diff --git a/taskd/clone.sh b/taskd/clone.sh index c5eb796..e641dfa 100755 --- a/taskd/clone.sh +++ b/taskd/clone.sh @@ -598,6 +598,7 @@ case "$url" in git config --add remote.origin.fetch "+refs/tags/*:refs/tags/*" git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*" git config --add remote.origin.fetch "+refs/top-bases/*:refs/top-bases/*" + git config --add remote.origin.fetch "+refs/replace/*:refs/replace/*" git config --bool girocco.lastupdateclean true else git config --replace-all remote.origin.fetch "+refs/*:refs/*" -- 2.11.4.GIT