# state of the index
i_tree=$(git write-tree) &&
- i_commit=$(printf 'index on %s' "$msg" |
+ i_commit=$(printf 'index on %s\n' "$msg" |
git commit-tree $i_tree -p $b_commit) ||
die "Cannot save the current index state"
if git-merge-recursive $b_tree -- $c_tree $w_tree
then
# No conflict
- a="$TMP-added" &&
- git diff --cached --name-only --diff-filter=A $c_tree >"$a" &&
- git read-tree --reset $c_tree &&
- git update-index --add --stdin <"$a" ||
- die "Cannot unstage modified files"
- rm -f "$a"
if test -n "$unstashed_index_tree"
then
git read-tree "$unstashed_index_tree"
+ else
+ a="$TMP-added" &&
+ git diff --cached --name-only --diff-filter=A $c_tree >"$a" &&
+ git read-tree --reset $c_tree &&
+ git update-index --add --stdin <"$a" ||
+ die "Cannot unstage modified files"
+ rm -f "$a"
fi
git status || :
else