append_matching_ref(): rewrite to take an object_id argument
[gitweb.git] / git-stash.sh
index 6846b18dbc007a8b08c6f5a77fe568fb8625c28f..7911f30c631fe58d6e5655f5213cae4e72ef99e1 100755 (executable)
@@ -442,6 +442,8 @@ apply_stash () {
        assert_stash_like "$@"
 
        git update-index -q --refresh || die "$(gettext "unable to refresh index")"
+       git diff-index --cached --quiet --ignore-submodules HEAD -- ||
+               die "$(gettext "Cannot apply stash: Your index contains uncommitted changes.")"
 
        # current index state
        c_tree=$(git write-tree) ||