]> source.dussan.org Git - jgit.git/commit
Fix resolving expression with ~ and ^ than extends beyond history 35/7735/3
authorDave Borowitz <dborowitz@google.com>
Tue, 18 Sep 2012 17:49:35 +0000 (19:49 +0200)
committerRobin Rosenberg <robin.rosenberg@dewire.com>
Tue, 18 Sep 2012 17:51:57 +0000 (19:51 +0200)
commit70ae16d708e0a207035872a16943f8b9151f33cd
treec4b81dd91f6d1d76808de361b108fd8e97182b63
parenta551493240d5513a101415e55742c689562d6f51
Fix resolving expression with ~ and ^ than extends beyond history

resolve("foo~X") where X is greater than the distance from foo to the
root should return null, but 2a2362fb introduced a bug causing it to
either return resolve("foo") or NPE. Add a test for the correct
behavior.

Also add an analogous test for foo^X where X is greater than the
number of parents (which was not broken by that commit).

Change-Id: Ic580081ece57c8c2df29b652897b425ecb34e11f
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryResolveTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java