[PATCH] Support ERR in remote archive like in fetch/push
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 3, 2011, 11:26 UTC
- Message-ID
- <20111003112649.GA12874@elie>
- In-Reply-To
- <20111003110159.GA13064@LK-Perkele-VI.localdomain>
Ilari Liusvaara wrote:
Show 9 quoted lines
> Oh, and adding interpretation of ERR packets to git archive is easy > (and I even happen to have git:// server that can send those to > test against): > > $ git archive --remote=git://localhost/foobar HEAD > fatal: remote error: R access for foobar DENIED to anonymous > > (I also tested that remote snapshotting of repository that should be > readable succeeds, it does).
Sounds like a good idea to me. Let's see what René thinks; also changing the subject line to attract other reviewers.
Show 30 quoted lines
> --- >8 ----
> From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
> Date: Mon, 3 Oct 2011 13:55:37 +0300
> Subject: [PATCH] Support ERR in remote archive like in fetch/push
>
> Make ERR as first packet of remote snapshot reply work like it does in
> fetch/push. Lets servers decline remote snapshot with message the same
> way as declining fetch/push with a message.
>
> Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
> ---
> builtin/archive.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/builtin/archive.c b/builtin/archive.c
> index 883c009..931956d 100644
> --- a/builtin/archive.c
> +++ b/builtin/archive.c
> @@ -61,6 +61,8 @@ static int run_remote_archiver(int argc, const char **argv,
> if (strcmp(buf, "ACK")) {
> if (len > 5 && !prefixcmp(buf, "NACK "))
> die(_("git archive: NACK %s"), buf + 5);
> + if (len > 4 && !prefixcmp(buf, "ERR "))
> + die(_("remote error: %s"), buf + 4);
> die(_("git archive: protocol error"));
> }
>
> --
> 1.7.7.3.g2791de.dirty
>