X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=builtin%2Fstash.c;h=ab30d1e9203b42dec154b4b171f74ba7fec1b6b7;hb=583cf6232a405e2535ad6a393b53387b290322c6;hp=b5a301f24d7a5f8b0a5f7d51703ca4cf38e2109c;hpb=b9ac6c59b82dead613b31a51c8bca4dbd441bcbe;p=thirdparty%2Fgit.git diff --git a/builtin/stash.c b/builtin/stash.c index b5a301f24d..ab30d1e920 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -396,7 +396,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info, const struct object_id *bases[1]; read_cache_preload(NULL); - if (refresh_cache(REFRESH_QUIET)) + if (refresh_and_write_cache(REFRESH_QUIET, 0, 0)) return -1; if (write_cache_as_tree(&c_tree, 0, NULL)) @@ -485,7 +485,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info, } if (quiet) { - if (refresh_cache(REFRESH_QUIET)) + if (refresh_and_write_cache(REFRESH_QUIET, 0, 0)) warning("could not refresh index"); } else { struct child_process cp = CHILD_PROCESS_INIT; @@ -1129,7 +1129,10 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b prepare_fallback_ident("git stash", "git@stash"); read_cache_preload(NULL); - refresh_cache(REFRESH_QUIET); + if (refresh_and_write_cache(REFRESH_QUIET, 0, 0) < 0) { + ret = -1; + goto done; + } if (get_oid("HEAD", &info->b_commit)) { if (!quiet) @@ -1290,7 +1293,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q free(ps_matched); } - if (refresh_cache(REFRESH_QUIET)) { + if (refresh_and_write_cache(REFRESH_QUIET, 0, 0)) { ret = -1; goto done; }