From f4cc88f6c7fa9633c4f8ac13b96cec58889f4084 Mon Sep 17 00:00:00 2001 From: Joseph Frazier <1212jtraceur@gmail.com> Date: Tue, 21 Mar 2017 20:12:15 -0400 Subject: [PATCH] git_stash_pop: Add only updated files This avoids adding untracked files to the repo. See here for a description of the difference between `git add .` and `git add --update`: https://stackoverflow.com/questions/572549/difference-between-git-add-a-and-git-add/572660#572660 --- tests/rules/test_git_stash_pop.py | 2 +- thefuck/rules/git_stash_pop.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/rules/test_git_stash_pop.py b/tests/rules/test_git_stash_pop.py index 2e0578e4..b82f0d56 100644 --- a/tests/rules/test_git_stash_pop.py +++ b/tests/rules/test_git_stash_pop.py @@ -15,4 +15,4 @@ def test_match(stderr): def test_get_new_command(stderr): assert (get_new_command(Command('git stash pop', stderr=stderr)) - == "git add . && git stash pop && git reset .") + == "git add --update && git stash pop && git reset .") diff --git a/thefuck/rules/git_stash_pop.py b/thefuck/rules/git_stash_pop.py index 2073c234..b8281362 100644 --- a/thefuck/rules/git_stash_pop.py +++ b/thefuck/rules/git_stash_pop.py @@ -11,7 +11,7 @@ def match(command): @git_support def get_new_command(command): - return shell.and_('git add .', 'git stash pop', 'git reset .') + return shell.and_('git add --update', 'git stash pop', 'git reset .') # make it come before the other applicable rules