diff options
Diffstat (limited to 'plugins/git4idea/tests/git4idea/test/GitScenarios.groovy')
-rw-r--r-- | plugins/git4idea/tests/git4idea/test/GitScenarios.groovy | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/git4idea/tests/git4idea/test/GitScenarios.groovy b/plugins/git4idea/tests/git4idea/test/GitScenarios.groovy index 77ecf0bc9e20..1fe574ad863d 100644 --- a/plugins/git4idea/tests/git4idea/test/GitScenarios.groovy +++ b/plugins/git4idea/tests/git4idea/test/GitScenarios.groovy @@ -38,14 +38,17 @@ class GitScenarios { /** * Create a branch with a commit and return back to master. */ - static def branchWithCommit(GitRepository repository, String name, String file = "branch_file.txt", String content = "branch content") { + static def branchWithCommit(GitRepository repository, String name, String file = "branch_file.txt", String content = "branch content", + boolean returnToMaster = true) { cd repository git("checkout -b $name") touch(file, content) git("add $file") git("commit -m branch_content") - git("checkout master") + if (returnToMaster) { + git("checkout master") + } } /** |