Skip to content

Commit 4134b4a

Browse files
committed
Merge pull request #47 from jacebrowning/hotfix/v0.4.1
Hotfix v0.4.1
2 parents ab6da28 + e0da10a commit 4134b4a

5 files changed

Lines changed: 18 additions & 13 deletions

File tree

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Revision History
22
================
33

4+
0.4.1 (2015/09/24)
5+
------------------
6+
7+
- Switched to cloning for initial working tree creation.
8+
49
0.4 (2015/09/18)
510
----------------
611

gdm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55
__project__ = 'GDM'
6-
__version__ = '0.4'
6+
__version__ = '0.4.1'
77

88
CLI = 'gdm'
99
VERSION = __project__ + ' v' + __version__

gdm/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ def update_files(self, force=False, clean=True):
4949

5050
# Enter the working tree
5151
if not os.path.exists(self.dir):
52-
self.mkdir(self.dir)
53-
self.cd(self.dir)
54-
if not os.path.exists('.git'): # create it if needed
5552
log.debug("creating a new repository...")
56-
self.git_create()
57-
elif not force: # exit if there are changes
53+
self.git_clone(self.repo, self.dir)
54+
self.cd(self.dir)
55+
56+
# Check for uncommitted changes
57+
if not force:
5858
log.debug("confirming there are no uncommitted changes...")
5959
if self.git_changes():
6060
common.show()

gdm/shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ class GitMixin(_Base):
7070

7171
"""Provides classes with Git utilities."""
7272

73-
def git_create(self):
74-
"""Initialize a new Git repository."""
75-
self._git('init')
73+
def git_clone(self, repo, path):
74+
"""Clone a new Git repository."""
75+
self._git('clone', repo, path)
7676

7777
def git_fetch(self, repo, rev=None):
7878
"""Fetch the latest changes from the remote repository."""

gdm/test/test_shell.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ class TestGit(_BaseTestCalls):
9999

100100
shell = GitMixin()
101101

102-
def test_create(self, mock_call):
103-
"""Verify the commands to create a new Git repository."""
104-
self.shell.git_create()
105-
self.assert_calls(mock_call, ["git init"])
102+
def test_clone(self, mock_call):
103+
"""Verify the commands to clone a new Git repository."""
104+
self.shell.git_clone('mock.git', 'mock/path')
105+
self.assert_calls(mock_call, ["git clone mock.git mock/path"])
106106

107107
def test_fetch(self, mock_call):
108108
"""Verify the commands to fetch from a Git repository."""

0 commit comments

Comments
 (0)