Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught (in promise) GitError: git apply --cached - in **file path** exited with code 1 #837

@DeanmvSG

Description

@DeanmvSG

Description

When trying to press the "Stage all" button in the top right of a file, sometimes it will looks like it does nothing, fail and the file will not get staged. This will throw an error into Atom's console of

Uncaught (in promise) GitError: git apply --cached - in **File Path** exited with code 1
stdout: 
stderr: error: patch failed: Site/Templates/Demo.html:8
error: Site/Templates/Demo.html: patch does not apply

    at new GitError (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:134:1)
    at /Applications/Atom Beta.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:342:1
    at next (<anonymous>)
    at step (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:103:1)
    at /Applications/Atom Beta.app/Contents/Resources/app/node_modules/github/lib/git-shell-out-strategy.js:110:1

This is the button that fails.
fails

Strangely, right clicking on the file in the "Unstaged Changes" pane and then click stage works correctly visually for the same file, but it seems that the error is still thrown in console.

This is the button that "works".
working

Steps to Reproduce

  1. Make changes in a file
  2. Click file in "Unstaged Changes" list and then click "Stage All" in the top right
  3. File doesn't "close" as it usually does, and file doesn't move from "Unstaged Changes" to "Staged Changes" as it fails

Expected behavior:

File to be staged correctly as does other times and then be able to commit/push

Actual behavior:

File doesn't close or get staged, just stays where it is and then an error is thrown into Atom's console.

Reproduces how often:

Probably around 20% of times that I go to stage a file. It is linked to the file you are staging as sometimes it works perfectly. I haven't got down exactly what causes it to happen yet (it looks like something in the commit that is causing it), I'll update if I can find out more.

EDIT: Replicated it again, GIF of the issue below!
may-17-2017 15-45-14

Versions

Atom    : 1.18.0-beta0
Electron: 1.3.15
Chrome  : 52.0.2743.82
Node    : 6.5.0

apm  1.18.1
npm  3.10.10
node 6.9.5 x64
python 2.7.10
git 2.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions