File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ require_work_tree
17
17
cd_to_toplevel
18
18
19
19
TMP=" $GIT_DIR /.git-stash.$$ "
20
- trap ' rm -f "$TMP-*"' 0
20
+ TMPindex=${GIT_INDEX_FILE-" $GIT_DIR /index" } .stash.$$
21
+ trap ' rm -f "$TMP-"* "$TMPindex"' 0
21
22
22
23
ref_stash=refs/stash
23
24
@@ -81,14 +82,12 @@ create_stash () {
81
82
82
83
# state of the working tree
83
84
w_tree=$( (
84
- rm -f " $TMP -index" &&
85
- cp -p ${GIT_INDEX_FILE-" $GIT_DIR /index" } " $TMP -index" &&
86
- GIT_INDEX_FILE=" $TMP -index" &&
85
+ git read-tree --index-output=" $TMPindex " -m $i_tree &&
86
+ GIT_INDEX_FILE=" $TMPindex " &&
87
87
export GIT_INDEX_FILE &&
88
- git read-tree -m $i_tree &&
89
88
git diff --name-only -z HEAD | git update-index -z --add --remove --stdin &&
90
89
git write-tree &&
91
- rm -f " $TMP -index "
90
+ rm -f " $TMPindex "
92
91
) ) ||
93
92
die " Cannot save the current worktree state"
94
93
You can’t perform that action at this time.
0 commit comments