[PATCH 2/2] stash: use "stash--helper"
- From
Matthias Asshauer <mha1993@live.de>
- Date
- Jan 28, 2016, 20:36 UTC
- Message-ID
- <0000015289f33e85-713596a1-2718-4c3a-bf3c-4a0f1048d401-000000@eu-west-1.amazonses.com>
- In-Reply-To
- <0000015289f33df4-d0095101-cfc0-4c41-b1e7-6137105b93fb-000000@eu-west-1.amazonses.com>
From: Matthias Aßhauer <mha1993@live.de>
Use the new "git stash--helper" builtin. It should be faster than the old shell code and is a first step to move more shell code to C.
Signed-off-by: Matthias Aßhauer <mha1993@live.de> --- git-stash.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh index c7c65e2..973c77b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -112,15 +112,7 @@ create_stash () { then # state of the working tree - w_tree=$( ( - git read-tree --index-output="$TMPindex" -m $i_tree && - GIT_INDEX_FILE="$TMPindex" && - export GIT_INDEX_FILE && - git diff --name-only -z HEAD -- >"$TMP-stagenames" && - git update-index -z --add --remove --stdin <"$TMP-stagenames" && - git write-tree && - rm -f "$TMPindex" - ) ) || + w_tree=$(git stash--helper --non-patch "$TMPindex" $i_tree) || die "$(gettext "Cannot save the current worktree state")" else -- https://github.com/git/git/pull/191