Thread (25 messages) flat view 25 messages, 5 authors, 2016-06-15

Re: Creating remote branch called HEAD corrupts remote clones

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:51:06

Possibly related (same subject, not in this thread)

On Wed, Apr 27, 2011 at 2:37 PM, Stephen Kelly [off-list ref] wrote:
It is not expected.

Alices repo is fubar'd. gitk doesn't work. The info about master being
ahead of remote etc is wrong or git push tells me it worked, though it
doesn't seem to.
gitk --all works fine, and gitk show a precise warning explaining the problem.

Also, the 'git push' worked fine. Perhaps what you didn't expect is
that when push.default=current, instead of pushing the current branch,
the 'HEAD' branch is being pushed.

So the test can be simplified to:

mkdir remote
cd remote/
git init --bare
cd ../
git clone remote/ alice
cd alice/
echo test >> file
git add file
git commit -am w
git push origin master
echo test >> file
git commit -am w
git branch HEAD
git push origin HEAD
git -c push.default=current push
git diff master origin/master

And the diff should be empty. With that in mind, it should be easy to
create a test script that does something similar, and add it to the
suite.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help