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

Re: [PATCH] Honor core.precomposeUnicode in more places

From
Jeff King <peff@peff.net>
Date
Jul 26, 2019, 19:47 UTC
Message-ID
<20190726194745.GA8076@sigill.intra.peff.net>
In-Reply-To
<20190423173056.28523-1-newren@gmail.com>
On Tue, Apr 23, 2019 at 10:30:56AM -0700, Elijah Newren wrote:
Show 18 quoted lines
> diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
> index f3353564f9..cfbd5c36c7 100644
> --- a/builtin/pack-refs.c
> +++ b/builtin/pack-refs.c
> @@ -1,4 +1,5 @@
>  #include "builtin.h"
> +#include "config.h"
>  #include "parse-options.h"
>  #include "refs.h"
>  #include "repository.h"
> @@ -16,6 +17,7 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
>  		OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
>  		OPT_END(),
>  	};
> +	git_config(git_default_config, NULL);
>  	if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
>  		usage_with_options(pack_refs_usage, opts);
>  	return refs_pack_refs(get_main_ref_store(the_repository), flags);

I coincidentally just wrote the same patch (working off a branch of v2.21, so I didn't yet have your fix here). Just for the record, this fixes other bugs, too!

Mine was:
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index 9ea5fa4fd2..07d09ac67a 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -253,4 +253,13 @@ test_expect_success SYMLINKS 'pack symlinked packed-refs' '
 	test "$(readlink .git/packed-refs)" = "my-deviant-packed-refs"
 '
 
+test_expect_success 'pack-refs respects core.useReplaceRefs' '
+	# this is broken because the object refers to itself
+	commit=$(git rev-parse HEAD) &&
+	test_when_finished "git update-ref -d refs/replace/$commit" &&
+	git update-ref refs/replace/$commit $commit &&
+	test_must_fail git pack-refs --all &&
+	git -c core.useReplaceRefs=false pack-refs --all
+'
+
 test_done

It's probably not worth adding the test independently, but I thought I'd
throw it out here for the benefit of the list archive.

-Peff
Previous: Elijah Newren
Message 6 of 6 in “Honor core.precomposeUnicode in more places”
  1. Honor core.precomposeUnicode in more placesElijah Newren, Apr 23, 2019
  2. Torsten BögershausenApr 23, 2019
  3. Elijah NewrenApr 23, 2019
  4. Junio C HamanoApr 24, 2019
  5. Honor core.precomposeUnicode in more placesElijah Newren, Apr 25, 2019
  6. Jeff KingJul 26, 2019

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.