diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2011-01-27 17:20:04 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2011-01-27 17:20:04 +0100 |
commit | 91af19de56759c04ca45eff91a8dfe850fa2fdf0 (patch) | |
tree | 13aa1fa7fc702ac5dd2c8f60443bcb6d1568c76e /org.eclipse.jgit.test | |
parent | afa7c7ab07a900831c5e6ea0d8c8f8d42297e7ce (diff) | |
download | jgit-91af19de56759c04ca45eff91a8dfe850fa2fdf0.tar.gz jgit-91af19de56759c04ca45eff91a8dfe850fa2fdf0.zip |
Hard reset should not report conflict on untracked file
This problem surfaced since EGit Core ResetOperationTest is failing
since change I26806d21. JGit detected checkout conflict for untracked
files which never were tracked by the repository.
"git reset --hard" in c git also doesn't remove such untracked files.
Change-Id: Icc8e1c548ecf6ed48bd2979c81eeb6f578d347bd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java index 1b4a9ff231..90a3f94167 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java @@ -128,11 +128,14 @@ public class DirCacheCheckoutTest extends ReadTreeTest { RevCommit topic = git.commit().setMessage("topic-1").call(); assertIndex(mkmap("f", "f()\nside", "G/i", "i()")); + writeTrashFile("untracked", "untracked"); + resetHard(master); assertIndex(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h", "h()")); resetHard(topic); assertIndex(mkmap("f", "f()\nside", "G/i", "i()")); - assertWorkDir(mkmap("f", "f()\nside", "G/i", "i()")); + assertWorkDir(mkmap("f", "f()\nside", "G/i", "i()", "untracked", + "untracked")); assertEquals(MergeStatus.CONFLICTING, git.merge().include(master) .call().getMergeStatus()); @@ -143,7 +146,7 @@ public class DirCacheCheckoutTest extends ReadTreeTest { resetHard(master); assertIndex(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h", "h()")); assertWorkDir(mkmap("f", "f()\nmaster", "D/g", "g()\ng2()", "E/h", - "h()")); + "h()", "untracked", "untracked")); } private DirCacheCheckout resetHard(RevCommit commit) |