denio7 / egit

Automatically exported from code.google.com/p/egit
0 stars 0 forks source link

It's possible to make HEAD ref to itself #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Select "Team > Branch > HEAD > ok"
2. Now .git/HEAD is "ref: HEAD"
3. readRefBasic throws IOException due circular references.

What is the expected output? What do you see instead?

 Circular references shouldn't be created.

What version of the product are you using? On what operating system?

 Lastest 9/10/2008 on MacOSX

Please provide any additional information below.

Original issue reported on code.google.com by Tomi.Pak...@gmail.com on 11 Sep 2008 at 8:09

GoogleCodeExporter commented 8 years ago
package org.spearce.jgit.lib;

Test case:

import java.io.IOException;

public class BranchTestCase extends RepositoryTestCase {
    public void testSelfRef() throws IOException {
        db.writeSymref("HEAD", "HEAD");
        db.resolve("HEAD");
    }
}

output:
java.io.IOException: Exceeded maximum ref depth of 5 at HEAD.  Circular 
reference?
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:331)
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:336)
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:336)
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:336)
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:336)
    at org.spearce.jgit.lib.RefDatabase.readRefBasic(RefDatabase.java:336)
    at org.spearce.jgit.lib.RefDatabase.readRef(RefDatabase.java:168)
    at org.spearce.jgit.lib.Repository.resolveSimple(Repository.java:748)
    at org.spearce.jgit.lib.Repository.resolve(Repository.java:741)
    at org.spearce.jgit.lib.BranchTestCase.test1(BranchTestCase.java:8)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:164)
    at junit.framework.TestCase.runBare(TestCase.java:130)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at junit.framework.TestSuite.runTest(TestSuite.java:230)
    at junit.framework.TestSuite.run(TestSuite.java:225)
    at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestR
eference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:460)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:196)

Original comment by Tomi.Pak...@gmail.com on 14 Sep 2008 at 9:40

GoogleCodeExporter commented 8 years ago
Moved to http://bugs.eclipse.org/286743

Original comment by robin.ro...@gmail.com on 16 Aug 2009 at 10:12

GoogleCodeExporter commented 8 years ago

Original comment by robin.ro...@gmail.com on 12 Jul 2010 at 5:12