* error from 'git push' on v1.7.8-rc0
@ 2011-11-03 11:43 Stefan Näwe
2011-11-03 11:49 ` Stefan Näwe
2011-11-03 18:59 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Näwe @ 2011-11-03 11:43 UTC (permalink / raw)
To: gitlist, Junio C Hamano
I get errors from git push when trying to delete a (remote) branch:
$ ./bin-wrappers/git versiongit version 1.7.8.rc0
$ ./bin-wrappers/git push -q . :refs/heads/nogofatal: bad object
0000000000000000000000000000000000000000fatal: bad object
0000000000000000000000000000000000000000remote: warning: Allowing
deletion of corrupt ref.
I bisected this to: 52fed6e receive-pack: check connectivity before
concluding "git push"
$ git describe 52fed6e~1
v1.7.5.3-492-gf96400c
$ ./bin-wrappers/git version
git version 1.7.5.3.492.gf9640
$ ./bin-wrappers/git push -q . :refs/heads/nogo
remote: warning: Allowing deletion of corrupt ref.
It makes no difference if the branch to be deleted exists, or not.
Regards,
Stefan
--
----------------------------------------------------------------
python -c "print '73746566616e2e6e6165776540676d61696c2e636f6d'.decode('hex')"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error from 'git push' on v1.7.8-rc0
2011-11-03 11:43 error from 'git push' on v1.7.8-rc0 Stefan Näwe
@ 2011-11-03 11:49 ` Stefan Näwe
2011-11-03 17:26 ` Stefan Naewe
2011-11-03 18:59 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Näwe @ 2011-11-03 11:49 UTC (permalink / raw)
To: gitlist, Junio C Hamano
On Thu, Nov 3, 2011 at 12:43 PM, Stefan Näwe <stefan.naewe@gmail.com> wrote:
> I get errors from git push when trying to delete a (remote) branch:
>
> $ ./bin-wrappers/git versiongit version 1.7.8.rc0
> $ ./bin-wrappers/git push -q . :refs/heads/nogofatal: bad object
$ ./bin-wrappers/git push -q . :refs/heads/nogo
(re-wrapped)
$ ./bin-wrappers/git push -q . :refs/heads/nogo
fatal: bad object 0000000000000000000000000000000000000000
fatal: bad object 0000000000000000000000000000000000000000
remote: warning: Allowing deletion of corrupt ref.
Stefan
--
----------------------------------------------------------------
python -c "print '73746566616e2e6e6165776540676d61696c2e636f6d'.decode('hex')"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error from 'git push' on v1.7.8-rc0
2011-11-03 11:49 ` Stefan Näwe
@ 2011-11-03 17:26 ` Stefan Naewe
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Naewe @ 2011-11-03 17:26 UTC (permalink / raw)
To: git
Stefan Näwe <stefan.naewe <at> gmail.com> writes:
>
> On Thu, Nov 3, 2011 at 12:43 PM, Stefan Näwe <stefan.naewe <at> gmail.com>
wrote:
> > I get errors from git push when trying to delete a (remote) branch:
> >
> > $ ./bin-wrappers/git versiongit version 1.7.8.rc0
> > $ ./bin-wrappers/git push -q . :refs/heads/nogofatal: bad object
> $ ./bin-wrappers/git push -q . :refs/heads/nogo
>
> (re-wrapped)
>
> $ ./bin-wrappers/git push -q . :refs/heads/nogo
> fatal: bad object 0000000000000000000000000000000000000000
> fatal: bad object 0000000000000000000000000000000000000000
> remote: warning: Allowing deletion of corrupt ref.
I think the problem lies actually in 'rev-list':
$ git rev-list --verify-objects 0000000000000000000000000000000000000000 \
--not --all
fatal: bad object 0000000000000000000000000000000000000000
Regards,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error from 'git push' on v1.7.8-rc0
2011-11-03 11:43 error from 'git push' on v1.7.8-rc0 Stefan Näwe
2011-11-03 11:49 ` Stefan Näwe
@ 2011-11-03 18:59 ` Junio C Hamano
2011-11-03 19:15 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2011-11-03 18:59 UTC (permalink / raw)
To: Stefan Näwe; +Cc: gitlist, Junio C Hamano
Stefan Näwe <stefan.naewe@gmail.com> writes:
> I get errors from git push when trying to delete a (remote) branch:
>
> $ ./bin-wrappers/git versiongit version 1.7.8.rc0
> $ ./bin-wrappers/git push -q . :refs/heads/nogofatal: bad object
> 0000000000000000000000000000000000000000fatal: bad object
> 0000000000000000000000000000000000000000remote: warning: Allowing
> deletion of corrupt ref.
Thanks. I think the operation does _not_ error out and fail to delete, but
I agree that the "fatal:" message should be squelched.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: error from 'git push' on v1.7.8-rc0
2011-11-03 18:59 ` Junio C Hamano
@ 2011-11-03 19:15 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2011-11-03 19:15 UTC (permalink / raw)
To: Stefan Näwe; +Cc: gitlist
Junio C Hamano <gitster@pobox.com> writes:
> Stefan Näwe <stefan.naewe@gmail.com> writes:
>
>> I get errors from git push when trying to delete a (remote) branch:
>>
>> $ ./bin-wrappers/git versiongit version 1.7.8.rc0
>> $ ./bin-wrappers/git push -q . :refs/heads/nogofatal: bad object
>> 0000000000000000000000000000000000000000fatal: bad object
>> 0000000000000000000000000000000000000000remote: warning: Allowing
>> deletion of corrupt ref.
>
> Thanks. I think the operation does _not_ error out and fail to delete, but
> I agree that the "fatal:" message should be squelched.
-- >8 --
Subject: receive-pack: do not expect object 0{40} to exist
When pushing to delete a ref, it uses 0{40} as an object name to signal
that the request is a deletion. We shouldn't trigger "deletion of a
corrupt ref" warning in such a case, which was designed to notice that a
ref points at an object that is truly missing from the repository.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/receive-pack.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 261b610..7ec68a1 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -634,7 +634,7 @@ static int command_singleton_iterator(void *cb_data, unsigned char sha1[20])
struct command **cmd_list = cb_data;
struct command *cmd = *cmd_list;
- if (!cmd)
+ if (!cmd || is_null_sha1(cmd->new_sha1))
return -1; /* end of list */
*cmd_list = NULL; /* this returns only one */
hashcpy(sha1, cmd->new_sha1);
@@ -659,11 +659,16 @@ static int iterate_receive_command_list(void *cb_data, unsigned char sha1[20])
struct command **cmd_list = cb_data;
struct command *cmd = *cmd_list;
- if (!cmd)
- return -1; /* end of list */
- *cmd_list = cmd->next;
- hashcpy(sha1, cmd->new_sha1);
- return 0;
+ while (cmd) {
+ if (!is_null_sha1(cmd->new_sha1)) {
+ hashcpy(sha1, cmd->new_sha1);
+ *cmd_list = cmd->next;
+ return 0;
+ }
+ cmd = cmd->next;
+ }
+ *cmd_list = NULL;
+ return -1; /* end of list */
}
static void execute_commands(struct command *commands, const char *unpacker_error)
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-11-03 19:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03 11:43 error from 'git push' on v1.7.8-rc0 Stefan Näwe
2011-11-03 11:49 ` Stefan Näwe
2011-11-03 17:26 ` Stefan Naewe
2011-11-03 18:59 ` Junio C Hamano
2011-11-03 19:15 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.