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

Re: [PATCH] index-pack: Don't follow replace refs.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Aug 12, 2010, 03:17 UTC
Message-ID
<201008120517.53874.chriscool@tuxfamily.org>
In-Reply-To
<1281401149-23141-1-git-send-email-nelhage@ksplice.com>
On Tuesday 10 August 2010 02:45:49 Nelson Elhage wrote:
> Without this, attempting to index a pack containing objects that have been
> replaced results in a fatal error that looks like:
> 
> fatal: SHA1 COLLISION FOUND WITH <replaced-object> !
I think it is a good patch except for a nit pick below.
Show 30 quoted lines
> Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
> ---
>  builtin/index-pack.c |    2 ++
>  t/t6050-replace.sh   |    6 ++++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/builtin/index-pack.c b/builtin/index-pack.c
> index a89ae83..fad76bf 100644
> --- a/builtin/index-pack.c
> +++ b/builtin/index-pack.c
> @@ -884,6 +884,8 @@ int cmd_index_pack(int argc, const char **argv, const
> char *prefix) if (argc == 2 && !strcmp(argv[1], "-h"))
>  		usage(index_pack_usage);
> 
> +	read_replace_refs = 0;
> +
>  	/*
>  	 * We wish to read the repository's config file if any, and
>  	 * for that it is necessary to call setup_git_directory_gently().
> diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
> index 203ffdb..b5635a7 100755
> --- a/t/t6050-replace.sh
> +++ b/t/t6050-replace.sh
> @@ -219,6 +219,12 @@ test_expect_success 'bisect and replacements' '
>       git bisect reset
>  '
> 
> +test_expect_success 'index-pack and replacements' '
> +     git --no-replace-objects rev-list --objects HEAD | \
> +       git --no-replace-objects pack-objects test-

Maybe you could add "&&" at the end of the above line to make sure that an error in the commands is caught.

So, for what it's worth, if the above is fixed:
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Show 6 quoted lines
> +     git index-pack test-*.pack
> +'
> +
>  #
>  #
>  test_done

Thanks, Christian.

Previous: Nelson Elhage
Message 2 of 2 in “index-pack: Don't follow replace refs.”
  1. index-pack: Don't follow replace refs.Nelson Elhage, Aug 10, 2010
  2. Christian CouderAug 12, 2010

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.