aboutsummaryrefslogtreecommitdiff
path: root/git-merge-one-file-script
diff options
context:
space:
mode:
authorPetr Baudis <pasky@ucw.cz>2005-06-08 23:26:55 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-08 15:54:45 -0700
commit8544a6f1b8e7340924c406d717ac37becd2f6046 (patch)
treec5a0b446a265a28ebfccee6a874fad2386678d2b /git-merge-one-file-script
parent7f1d1129628c63f46aebe03afacdb2ab259ef2d6 (diff)
downloadgit-8544a6f1b8e7340924c406d717ac37becd2f6046.tar.gz
git-8544a6f1b8e7340924c406d717ac37becd2f6046.tar.xz
[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: Petr Baudis <pasky@ucw.cz> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'git-merge-one-file-script')
-rwxr-xr-xgit-merge-one-file-script4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-merge-one-file-script b/git-merge-one-file-script
index 62cbb2a9d..cf42ff63c 100755
--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -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