Use 'git merge -Xsubtree' when git version >= 1.7.0.
It's possible to specify the subdir of a subtree since Git 1.7.0 - adding support for that functionality to make the merge more stable. Also checking for git version - now only uses the new subtree subdir option when on at least 1.7.
This commit is contained in:
parent
c00d1d1168
commit
448e71e263
@ -634,11 +634,20 @@ cmd_merge()
|
|||||||
debug "New squash commit: $new"
|
debug "New squash commit: $new"
|
||||||
rev="$new"
|
rev="$new"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$message" ]; then
|
version=$(git version)
|
||||||
git merge -s subtree --message="$message" $rev
|
if [ "$version" \< "git version 1.7" ]; then
|
||||||
|
if [ -n "$message" ]; then
|
||||||
|
git merge -s subtree --message="$message" $rev
|
||||||
|
else
|
||||||
|
git merge -s subtree $rev
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
git merge -s subtree $rev
|
if [ -n "$message" ]; then
|
||||||
|
git merge -Xsubtree="$prefix" --message="$message" $rev
|
||||||
|
else
|
||||||
|
git merge -Xsubtree="$prefix" $rev
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user