"Cannot pop stashed changes"

Create issue
Issue #1136 closed
Erik Schnetter created an issue

When updating, GetComponents often reports errors about git repositories stating "cannot pop stashed changes". In many cases, this simply means that there are no stashed changes, i.e. no local modifications, which is harmless and should not lead to a warning.

However, if there is a real problem, this warning needs to remain.


Comments (6)

  1. Ian Hinder
    • removed comment

    The function git_stash_update_repo is responsible for this. It already includes a check for whether there are changes to stash. Something about this check must not be working correctly. If there are changes to stash, then the stash command should stash them, and the stash pop should always succeed. Someone should investigate the details of exactly why this is happening; I can't see anything obviously wrong with the code.

  2. Erik Schnetter reporter
    • removed comment

    "git stash pop" reports an error when there is no stash. Working on a patch.

  3. Ian Hinder
    • removed comment

    Do you know why the git diff-files was reporting that there were changes, and yet the stash didn't stash anything? Is it because git diff-files is the wrong command to use, and we should use git diff instead? I didn't know git diff-files existed until I saw this code.

  4. Erik Schnetter reporter
    • removed comment

    I don't know. However, we shouldn't be second-guessing whether git stash will create a stash or not -- we should just call git stash, and then see whether a stash was created.

  5. Log in to comment