Skip to content

Stash error with conflicted file upon new branch creation due to untracked files #8084

Closed

Description

@kuychaco

Description

When switching branches and carrying over changes that produce a conflict there is an edge case when untracked files are involved in the conflict. Desktop stashes the untracked file, creates the new branch, and tries to apply the stashed changes on the new branch. But if the new branch already contains a file that corresponds to the stashed untracked file, Git throws an error and doesn't allow the changes to be applied.

image

For reference -- I pulled this out as a separate issue from #7827 (comment). It's a distinct bug and pertains specifically to untracked files being stashed as part of checking out a new branch.

Version

  • GitHub Desktop: Desktop-dev a6a2bf7
  • Operating system: macOS High Sierra 10.13.6

Steps to Reproduce

  1. checkout master
  2. create branch branch-a
  3. create new file file.txt on master and commit
  4. checkout branch-a and create new file file.txt with conflicting changes. do not stage or commit.
  5. checkout new branch branch-b based off of master. select option to carry over changes. (note: you also hit the error by checking out master instead of creating a new branch)

Expected Behavior

branch-b is checked out and file.txt shows conflicting changes

Actual Behavior

Error appears (see screenshot above)

Additional Information

N/A

Logs

N/A

Activity

  1. self-assigned this
    on Aug 9, 2019
  2. added a commit that references this issue on Aug 9, 2019
    d762711
  3. tierninho commented on Aug 9, 2019

    @tierninho
    Contributor

    I noticed as part of this bug that the stash sometimes results in the user being unable to click discard or restore. Switching tabs and returning resolves it. I suppose this will be moot once the bug fix comes in.

    Screen Shot 2019-08-09 at 11 08 31 AM

  4. added
    bug
    priority-3
    on Aug 9, 2019
  5. benplay2 commented on Aug 19, 2019

    @benplay2

    I encountered this recently as well and it caused an infinite loop of GitHub Desktop stashing local changes & retrying. I had to quit the application, pop one of the many stashes, and clear the others before manually handling the untracked file to get around the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority-3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions