| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1023,3 +1023,25 @@ def test_git_work_tree_env(self, rw_dir): | |||
| 1023 | 1023 | self.assertEqual(r.working_dir, repo_dir) | |
| 1024 | 1024 | finally: | |
| 1025 | 1025 | os.environ = oldenv | |
| 1026 | + | ||
| 1027 | + @with_rw_directory | ||
| 1028 | + def test_rebasing(self, rw_dir): | ||
| 1029 | + r = Repo.init(rw_dir) | ||
| 1030 | + fp = osp.join(rw_dir, 'hello.txt') | ||
| 1031 | + r.git.commit("--allow-empty", message="init",) | ||
| 1032 | + with open(fp, 'w') as fs: | ||
| 1033 | + fs.write("hello world") | ||
| 1034 | + r.git.add(Git.polish_url(fp)) | ||
| 1035 | + r.git.commit(message="English") | ||
| 1036 | + self.assertEqual(r.currently_rebasing_on(), None) | ||
| 1037 | + r.git.checkout("HEAD^1") | ||
| 1038 | + with open(fp, 'w') as fs: | ||
| 1039 | + fs.write("Hola Mundo") | ||
| 1040 | + r.git.add(Git.polish_url(fp)) | ||
| 1041 | + r.git.commit(message="Spanish") | ||
| 1042 | + commitSpanish = r.commit() | ||
| 1043 | + try: | ||
| 1044 | + r.git.rebase("master") | ||
| 1045 | + except GitCommandError: | ||
| 1046 | + pass | ||
| 1047 | + self.assertEqual(r.currently_rebasing_on(), commitSpanish) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments