Re: [RFC/PATCH v3 2/3] sha1_file: prepare for adding alternates on demand
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 22, 2009, 23:43 UTC
- Message-ID
- <alpine.DEB.1.00.0901230041500.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <1232659071-14401-3-git-send-email-hjemli@gmail.com>
Hi,
On Thu, 22 Jan 2009, Lars Hjemli wrote:
Show 27 quoted lines
> @@ -285,9 +286,10 @@ static int link_alt_odb_entry(const char * entry, int len, const char * relative
>
> /* Detect cases where alternate disappeared */
> if (!is_directory(ent->base)) {
> - error("object directory %s does not exist; "
> - "check .git/objects/info/alternates.",
> - ent->base);
> + if (!quiet)
> + error("object directory %s does not exist; "
> + "check .git/objects/info/alternates.",
> + ent->base);
> free(ent);
> return -1;
> }
> [...]
> @@ -2573,3 +2579,11 @@ int read_pack_header(int fd, struct pack_header *header)
> return PH_ERROR_PROTOCOL;
> return 0;
> }
> +
> +int add_alt_odb(char *path, int quiet)
> +{
> + int err = link_alt_odb_entry(path, strlen(path), NULL, 0, quiet);
> + if (!err)
> + prepare_packed_git_one(path, 0);
> + return err;
> +}FWIW my concern is not at all addressed. A future user of add_alt_odb() (and possibly your users in rare cases, too) can trigger the error that suggests looking into the alternates. Leaving the human user puzzled.
Ciao, Dscho