Re: A bug or unhandled case
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 11, 2013, 16:29 UTC
- Message-ID
- <7vvc8xaoia.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CABB6UqEfx=ssbiD1+2HA3AtmSrFeJeg5fmU3z1SKukNsKvd4qw@mail.gmail.com>
Michał Janiszewski <janisozaur@gmail.com> writes:
Show 12 quoted lines
> Hi, > I think I've found a bug in git or at least a use case that is not handled. > In few words it can be described like this: if you push a remote > branch to another remote, which is bare repository, you cannot remove > that branch from said bare repository. > Here is a recipe how to reproduce that with git 1.8.0: > git init foo > git init --bare bar.git > git init --bare baz.git > cd foo > echo test > file > git commit -am "initial commit"
Nothing added, nothing committed, at this point. I'd assume there is "git add file" before this commit.
Show 10 quoted lines
> git remote add bar ../bar.git > git remote add baz ../baz.git > git push bar master > cd .. > git clone bar.git bax > cd bax > git checkout -b "test_branch" > echo evil > file > git commit -am "evil commit" > git push origin test-branch
error: src refspec test-branch does not match any. error: failed to push some refs to '...../bar.git'
I'd assume that is test_branch
Show 7 quoted lines
> cd ../foo > git fetch bar > git push baz bar/test_branch > cd ../baz.git > > ### > # on that point in baz.git there is only one branch:
Correct.
> # remotes/bar/test_branch 8b96ffe evil commit > # trying to remove that branch yields no results: > $ git branch -D refs/remotes/bar/test_branch
That is not the way to remove the remote tracking branch test_branch you have from remote bar, is it?
git branch -r -D bar/test_branch