1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00
thefuck/tests
Joseph Frazier 8c62706db4 Fix git stash pop with local changes
When there are local changes to a file, and a git stash is popped that
contains other changes to that same file, git fails as follows:

    $ git stash pop
    error: Your local changes to the following files would be overwritten by merge:
            src/index.js
    Please commit your changes or stash them before you merge.
    Aborting
    $

This change adds a rule that corrects this problem as suggested [here]:

    $ git stash pop
    error: Your local changes to the following files would be overwritten by merge:
            src/index.js
    Please commit your changes or stash them before you merge.
    Aborting
    $ fuck
    git add . && git stash pop && git reset . [enter/↑/↓/ctrl+c]
    Auto-merging src/index.js
    On branch flow
    Changes to be committed:
      (use "git reset HEAD <file>..." to unstage)

            modified:   src/index.js

    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)

            modified:   src/index.js

    Dropped refs/stash@{0} (f94776d484c4278997ac6837a7b138b9b9cdead1)
    Unstaged changes after reset:
    M        src/index.js
    $

[here]: https://stackoverflow.com/questions/15126463/how-do-i-merge-local-modifications-with-a-git-stash-without-an-extra-commit/15126489#15126489
2016-12-11 12:44:04 -05:00
..
functional test_zsh.py: use official python images, not ubuntu 2016-10-06 11:15:18 -04:00
rules Fix git stash pop with local changes 2016-12-11 12:44:04 -05:00
shells Merge pull request #580 from josephfrazier/bash-command-substitution 2016-11-30 15:49:47 +01:00
specific #N/A: Add npm_missing_script rule 2016-08-13 18:28:45 +03:00
__init__.py Fix tests with python 2 2015-04-25 03:13:57 +02:00
conftest.py #N/A: Monkeypatch pathlib on windows 2016-08-14 15:15:03 +03:00
test_conf.py #540: Fix code style, add test 2016-08-22 05:45:27 +03:00
test_corrector.py #N/A: Monkeypatch pathlib on windows 2016-08-14 15:15:03 +03:00
test_logs.py Fix some more warnings from flake8 2015-11-15 18:08:59 +01:00
test_readme.py Minor refactoring 2015-09-08 15:24:49 +03:00
test_types.py #N/A: Monkeypatch pathlib on windows 2016-08-14 15:15:03 +03:00
test_ui.py ui: accept 'q' as quit character 2016-06-25 12:31:08 +02:00
test_utils.py #N/A: Remove old-style rules support 2016-08-14 14:37:32 +03:00
utils.py #N/A: Move all consts to const 2016-02-22 18:40:28 +03:00