Skip to content

Commit f3d3248

Browse files
committed
Refresh current index before trying to stash changes
In some cases, `git update-index -q --refresh` does not update an index. Please read about "why?" on https://stackoverflow.com/a/34808299/10418734. So, the `--refresh` option is replaced with `--really-refresh` which aims to do a real index refresh.
1 parent 2689246 commit f3d3248

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

.workflows/ci-pipeline.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pipeline() {
3232
--verbose --file=/dev/null || fail "Unreadable todo is identified."
3333
(
3434
.workflows/docs-generation.bash
35-
git update-index --refresh
35+
git update-index --really-refresh
3636
git diff-index --quiet HEAD --
3737
) || fail "The documentation is not up to date. Please run './.workflows/docs-generation.bash' and commit the changes"
3838

libexec/plugins/pipe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stash-pipe() {
66
# Makes automatic stash and unstash if possible
77
# usage: stash-pipe <command> [args]...
88

9-
git update-index -q --refresh
9+
git update-index -q --really-refresh
1010
if ! git diff-index --quiet HEAD --; then
1111
local message="Elegant Git auto-stash: "
1212
message+="WIP in '$(git rev-parse --abbrev-ref HEAD)' branch "
@@ -17,7 +17,7 @@ stash-pipe() {
1717
"${@}"
1818

1919
if [[ -n "${message}" ]]; then
20-
git update-index -q --refresh
20+
git update-index -q --really-refresh
2121
git-verbose stash pop $(git stash list --grep="${message}" --format="%gd")
2222
fi
2323
}

0 commit comments

Comments
 (0)