Skip to content
  • Jeff King's avatar
    stash: drop dirty worktree check on apply · e0e2a9cb
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Before we apply a stash, we make sure there are no changes
    in the worktree that are not in the index. This check dates
    back to the original git-stash.sh, and is presumably
    intended to prevent changes in the working tree from being
    accidentally lost during the merge.
    
    However, this check has two problems:
    
      1. It is overly restrictive. If my stash changes only file
         "foo", but "bar" is dirty in the working tree, it will
         prevent us from applying the stash.
    
      2. It is redundant. We don't touch the working tree at all
         until we actually call merge-recursive. But it has its
         own (much more accurate) checks to avoid losing working
         tree data, and will abort the merge with a nicer
         message telling us which paths were problems.
    
    So we can simply drop the check entirely.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    e0e2a9cb