{"thread":{"id":"17319","subject":"[PATCH 1/7] refs: add a \"for_each_replace_ref\" function","startedAt":"2009-01-23T09:06:38Z","lastAt":"2009-01-23T09:06:38Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"101636","messageId":"20090123100638.29039543.chriscool@tuxfamily.org","threadId":"17319","inReplyTo":null,"subject":"[PATCH 1/7] refs: add a \"for_each_replace_ref\" function","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-01-23T09:06:38Z","receivedAt":"2009-01-23T09:06:38Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This is some preparation work for the following patches that are using\nthe \"refs/replace/\" ref namespace.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n refs.c |    5 +++++\n refs.h |    1 +\n 2 files changed, 6 insertions(+), 0 deletions(-)\n\n\tHere is a new patch series. I only fixed what Junio reported\n\tas bugs (thanks) and added a global switch to forbid the\n\treplacement for connectivity walkers. I added a few test\n\tcases for the latter, but I may be missing a lot of things.\n\ndiff --git a/refs.c b/refs.c\nindex 33ced65..042106d 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -632,6 +632,11 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data)\n \treturn do_for_each_ref(\"refs/remotes/\", fn, 13, cb_data);\n }\n \n+int for_each_replace_ref(each_ref_fn fn, void *cb_data)\n+{\n+\treturn do_for_each_ref(\"refs/replace/\", fn, 13, cb_data);\n+}\n+\n /*\n  * Make sure \"ref\" is something reasonable to have under \".git/refs/\";\n  * We do not like it if:\ndiff --git a/refs.h b/refs.h\nindex 06ad260..8d2ee5a 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -23,6 +23,7 @@ extern int for_each_ref(each_ref_fn, void *);\n extern int for_each_tag_ref(each_ref_fn, void *);\n extern int for_each_branch_ref(each_ref_fn, void *);\n extern int for_each_remote_ref(each_ref_fn, void *);\n+extern int for_each_replace_ref(each_ref_fn, void *);\n \n /*\n  * Extra refs will be listed by for_each_ref() before any actual refs\n-- \n1.6.1.231.g9c286\n"}]}