Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly stash with submodules #27

Merged
merged 3 commits into from
Feb 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions PyGitUp/git_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def stash(self):
"""
stashed = False

if self.repo.is_dirty():
if self.repo.is_dirty(submodules=False):
if self.change_count > 1:
message = 'stashing {0} changes'
else:
Expand Down Expand Up @@ -188,10 +188,11 @@ def config(self, key):
@property
def change_count(self):
""" The number of changes in the working directory. """
return len(
self.git.status(porcelain=True, untracked_files='no').split(
'\n')
)
status = self.git.status(porcelain=True, untracked_files='no').strip()
if not status:
return 0
else:
return len(status.split('\n'))

@property
def version(self):
Expand Down