BUG? git stash and immediate git apply results in conflict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello!

I believe there might be a bug in how a git stash is calculated with
the -k flag.
I would expect to always be able to stash and pop a set of changes,
but if the working directory contains staged and unstaged changes for
a file, this results in a conflict.

The stashed diff shows the changes from the last commit, rather than
what is in the current working directory, so when the stash is applied
it results in a conflict, because there are staged changes in the
current working directory.

Steps to reproduce:

 mkdir test
 cd test
 git init .
 echo foo > a
 echo bar >> a
 echo baz >> a
 git add a
 git commit -m "initial"
 cat a | sed s/bar/foo2/ > a2; mv a2 a git status
 git add a
 cat a | sed s/foo2/xxx/ > a2; mv a2 a
 git status
 git stash -ku
 git stash pop

Thanks for looking into this,
  Akos Vandra-Meyer



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux