Пример #1
0
 def test_update_no_clean(self, mock_call):
     git.update('mock_rev', clean=False)
     assert_calls(mock_call, [
         "git stash",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Пример #2
0
 def test_update_no_clean(self, mock_call):
     git.update('mock_rev', clean=False)
     check_calls(mock_call, [
         "git stash",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Пример #3
0
 def test_update(self, mock_call):
     """Verify the commands to update a working tree to a revision."""
     git.update('mock_rev')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Пример #4
0
 def test_update(self, mock_call):
     """Verify the commands to update a working tree to a revision."""
     git.update('mock_rev')
     check_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_rev",
         "git branch --set-upstream-to origin/mock_rev",
     ])
Пример #5
0
 def test_update_branch(self, mock_call):
     """Verify the commands to update a working tree to a branch."""
     git.update('mock_branch', fetch=True)
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git branch --set-upstream-to origin/mock_branch",
         "git pull --ff-only --no-rebase",
     ])
Пример #6
0
 def test_update_branch(self, mock_call):
     """Verify the commands to update a working tree to a branch."""
     git.update('mock_branch', fetch=True)
     check_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git branch --set-upstream-to origin/mock_branch",
         "git pull --ff-only --no-rebase",
     ])
Пример #7
0
 def test_update_revparse(self, mock_call):
     """Verify the commands to update a working tree to a rev-parse."""
     mock_call.return_value = "abc123"
     git.update('mock_branch@{2015-02-12 18:30:00}')
     assert_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git rev-list -n 1 --before='2015-02-12 18:30:00' mock_branch",
         "git checkout --force abc123",
         "git branch --set-upstream-to origin/abc123",
     ])
Пример #8
0
 def test_update_revparse(self, mock_call):
     """Verify the commands to update a working tree to a rev-parse."""
     mock_call.return_value = ["abc123"]
     git.update('mock_branch@{2015-02-12 18:30:00}')
     check_calls(mock_call, [
         "git stash",
         "git clean --force -d -x",
         "git checkout --force mock_branch",
         "git rev-list -n 1 --before='2015-02-12 18:30:00' mock_branch",
         "git checkout --force abc123",
         "git branch --set-upstream-to origin/abc123",
     ])