Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed May 31, 2016
2 parents e34df93 + 7f9d98a commit d762b3e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision History

## 1.0.1 (2016/05/31)

- Replaced calls to `git remote add origin` with `git remote set-url origin`.

## 1.0 (2016/05/22)

- Initial stable release.
Expand Down
2 changes: 1 addition & 1 deletion gitman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

__project__ = 'GitMan'
__version__ = '1.0'
__version__ = '1.0.1'

CLI = 'gitman'
PLUGIN = 'deps'
Expand Down
3 changes: 1 addition & 2 deletions gitman/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def clone(repo, path, *, cache=None):

def fetch(repo, rev=None):
"""Fetch the latest changes from the remote repository."""
git('remote', 'rm', 'origin', _show=False, _ignore=True)
git('remote', 'add', 'origin', repo)
git('remote', 'set-url', 'origin', repo)
args = ['fetch', '--tags', '--force', '--prune', 'origin']
if rev:
if len(rev) == 40:
Expand Down
13 changes: 4 additions & 9 deletions gitman/test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

@patch('gitman.git.call')
class TestGit:

"""Tests for calls to Git."""

@patch('os.path.isdir', Mock(return_value=False))
Expand All @@ -32,35 +31,31 @@ def test_fetch(self, mock_call):
"""Verify the commands to fetch from a Git repository."""
git.fetch('mock.git')
assert_calls(mock_call, [
"git remote rm origin",
"git remote add origin mock.git",
"git remote set-url origin mock.git",
"git fetch --tags --force --prune origin",
])

def test_fetch_rev(self, mock_call):
"""Verify the commands to fetch from a Git repository w/ rev."""
git.fetch('mock.git', 'mock-rev')
assert_calls(mock_call, [
"git remote rm origin",
"git remote add origin mock.git",
"git remote set-url origin mock.git",
"git fetch --tags --force --prune origin mock-rev",
])

def test_fetch_rev_sha(self, mock_call):
"""Verify the commands to fetch from a Git repository w/ SHA."""
git.fetch('mock.git', 'abcdef1234' * 4)
assert_calls(mock_call, [
"git remote rm origin",
"git remote add origin mock.git",
"git remote set-url origin mock.git",
"git fetch --tags --force --prune origin",
])

def test_fetch_rev_revparse(self, mock_call):
"""Verify the commands to fetch from a Git repository w/ rev-parse."""
git.fetch('mock.git', 'master@{2015-02-12 18:30:00}')
assert_calls(mock_call, [
"git remote rm origin",
"git remote add origin mock.git",
"git remote set-url origin mock.git",
"git fetch --tags --force --prune origin",
])

Expand Down

0 comments on commit d762b3e

Please sign in to comment.