diff options
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | 2007-11-29 04:02:53 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-01 01:59:43 +0300 |
commit | 28391a80a94d2b59d1d21f8264fe5dab91d77249 (patch) | |
tree | ecad6b60280162cff18197f5b069c6df6801a025 /builtin-prune.c | |
parent | 346d203bc3931c33f2e40093ee9325ab0334b9fe (diff) |
receive-pack: allow deletion of corrupt refs
Occasionally, in some setups (*cough* forks on repo.or.cz *cough*) some
refs go stale, e.g. when the forkee rebased and lost some objects needed
by the fork. The quick & dirty way to deal with those refs is to delete
them and push them again.
However, git-push first would first fetch the current commit name for the
ref, would receive a null sha1 since the ref does not point to a valid
object, then tell receive-pack that it should delete the ref with this
commit name. delete_ref() would be subsequently be called, and check that
resolve_ref() (which does _not_ check for validity of the object) returns
the same commit name. Which would fail.
The proper fix is to avoid corrupting repositories, but in the meantime
this is a good fix in any case.
Incidentally, some instances of "cd .." in the test cases were fixed, so
that subsequent test cases run in t/trash/ irrespective of the outcome of
the previous test cases.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-prune.c')
0 files changed, 0 insertions, 0 deletions