diff --git a/builtin/stash.c b/builtin/stash.c index 7a9843413b..9a5006e3d9 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1655,8 +1655,6 @@ static int create_stash(int argc, const char **argv, const char *prefix UNUSED, strbuf_join_argv(&stash_msg_buf, argc - 1, ++argv, ' '); memset(&ps, 0, sizeof(ps)); - if (!check_changes_tracked_files(&ps)) - return 0; ret = do_create_stash(&ps, &stash_msg_buf, 0, 0, NULL, 0, &info, NULL, 0); @@ -1665,7 +1663,11 @@ static int create_stash(int argc, const char **argv, const char *prefix UNUSED, free_stash_info(&info); strbuf_release(&stash_msg_buf); - return ret; + /* + * ret is 1 if there were no changes. In this case, we should + * not error out. + */ + return ret < 0; } static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int quiet,