提交 8544a6f1 编写于 作者: P Petr Baudis 提交者: Linus Torvalds

[PATCH] Fix git-merge-one-file permissions auto-merging

In the automerge case, permissions were not restored properly after the
merge tool was invoked and overwrote the target file.
Signed-off-by: NPetr Baudis <pasky@ucw.cz>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 7f1d1129
......@@ -63,10 +63,14 @@ case "${1:-.}${2:-.}${3:-.}" in
merge -p "$src1" "$orig" "$src2" > "$4"
ret=$?
rm -f -- "$orig" "$src1" "$src2"
if [ "$6" != "$7" ]; then
echo "ERROR: Permissions $5->$6->$7 don't match."
ret=1
fi
case "$6" in *7??) mode=+x;; *) mode=-x;; esac
chmod "$mode" "$4"
if [ $ret -ne 0 ]; then
# Reset the index to the first branch, making
# git-diff-file useful
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册