summaryrefslogtreecommitdiff
path: root/git-merge-one-file-script
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2005-04-19 02:55:19 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org.(none)>2005-04-19 02:55:19 (GMT)
commit0a9ea850005de0fb74b6288d281eb0417e869b00 (patch)
tree8448ea54267e04be5961bb3a41b6361eb15a2771 /git-merge-one-file-script
parentb70070f0208be5d5d7b7a3b259e7ff3da19307d0 (diff)
downloadgit-0a9ea850005de0fb74b6288d281eb0417e869b00.zip
git-0a9ea850005de0fb74b6288d281eb0417e869b00.tar.gz
git-0a9ea850005de0fb74b6288d281eb0417e869b00.tar.bz2
[PATCH] SCSI trees, merges and git status
Doing the latest SCSI merge exposed two bugs in your merge script: 1) It doesn't like a completely new directory (the misc tree contains a new drivers/scsi/lpfc) 2) the merge testing logic is wrong. You only want to exit 1 if the merge fails.
Diffstat (limited to 'git-merge-one-file-script')
-rwxr-xr-xgit-merge-one-file-script11
1 files changed, 10 insertions, 1 deletions
diff --git a/git-merge-one-file-script b/git-merge-one-file-script
index df1a679..b2adc5f 100755
--- a/git-merge-one-file-script
+++ b/git-merge-one-file-script
@@ -13,6 +13,11 @@
# do any merges that migth change the tree layout
#
+# if the directory is newly added in a branch, it might not exist
+# in the current tree
+dir=$(dirname "$4")
+mkdir -p "$dir"
+
case "${1:-.}${2:-.}${3:-.}" in
#
# deleted in both, or deleted in one and unchanged in the other
@@ -40,7 +45,11 @@ case "${1:-.}${2:-.}${3:-.}" in
orig=$(unpack-file $1)
src1=$(unpack-file $2)
src2=$(unpack-file $3)
- merge "$src2" "$orig" "$src1" || echo Leaving conflict merge in $src2 && exit 1
+ merge "$src2" "$orig" "$src1"
+ if [ $? -ne 0 ]; then
+ echo Leaving conflict merge in $src2
+ exit 1
+ fi
cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
;;