diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-02-13 14:44:49 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-02-13 14:44:49 -0800 |
| commit | bd10c45672068811cb13cb0edba78470f537f233 (patch) | |
| tree | b775e7c015a8893dff11ee553c37e7808d0bf35e /builtin/stash.c | |
| parent | Merge branch 'jc/sign-buffer-failure-propagation-fix' into maint-2.43 (diff) | |
| parent | builtin/stash: report failure to write to index (diff) | |
| download | git-bd10c45672068811cb13cb0edba78470f537f233.tar.gz git-bd10c45672068811cb13cb0edba78470f537f233.zip | |
Merge branch 'ps/report-failure-from-git-stash' into maint-2.43
"git stash" sometimes was silent even when it failed due to
unwritable index file, which has been corrected.
* ps/report-failure-from-git-stash:
builtin/stash: report failure to write to index
Diffstat (limited to 'builtin/stash.c')
| -rw-r--r-- | builtin/stash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index b2813c614c..7fb355bff0 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -520,7 +520,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree) repo_hold_locked_index(the_repository, &lock, LOCK_DIE_ON_ERROR); if (write_locked_index(&the_index, &lock, COMMIT_LOCK | SKIP_IF_UNCHANGED)) - die(_("Unable to write index.")); + die(_("could not write index")); } static int do_apply_stash(const char *prefix, struct stash_info *info, @@ -537,7 +537,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info, repo_read_index_preload(the_repository, NULL, 0); if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0, NULL, NULL, NULL)) - return -1; + return error(_("could not write index")); if (write_index_as_tree(&c_tree, &the_index, get_index_file(), 0, NULL)) @@ -1364,7 +1364,7 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b repo_read_index_preload(the_repository, NULL, 0); if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0, NULL, NULL, NULL) < 0) { - ret = -1; + ret = error(_("could not write index")); goto done; } @@ -1555,7 +1555,7 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0, NULL, NULL, NULL)) { - ret = -1; + ret = error(_("could not write index")); goto done; } |
