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

Differentiate between staged and unstaged changes #136

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Show staged changes even in a dirty file.
  • Loading branch information
jisaacks committed Jan 28, 2014
commit bb3ffeb7a50eb9a4ca43b7bf579170c22b3e24c1
3 changes: 1 addition & 2 deletions git_gutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ def run(self):
elif ViewCollection.ignored(self.view):
self.bind_files('ignored')
else:
dirty = self.view.is_dirty()
staged = ViewCollection.has_stages(self.view)
if staged and not dirty:
if staged:
# FIXME
# * dry up the 3 blocks of code below that all look the same
# * only qualify unstaged changes when there _are_ staged ones
Expand Down
4 changes: 2 additions & 2 deletions git_gutter_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ def diff(self):
# Refactor staged/diff methods to dry up duplicated code
def staged(self):
if self.on_disk() and self.git_path:
self.update_git_file()
self.update_stg_file()
self.update_buf_file()
args = [
self.git_binary_path, 'diff', '-U0', '--no-color',
self.stg_temp_file.name,
self.view.file_name()
self.buf_temp_file.name
]
args = list(filter(None, args)) # Remove empty args
results = self.run_command(args)
Expand Down