@@ -778,12 +778,29 @@ ensure_valid_ref_format () {
die "fatal: '$1' does not look like a ref"
}
+# Usage: check if a commit from another subtree should be ignored from processing for splits
+should_ignore_subtree_commit () {
+ if [ "$(git log -1 --grep="git-subtree-dir:" $1)" ]
+ then
+ if [[ -z "$(git log -1 --grep="git-subtree-mainline:" $1)" && -z "$(git log -1 --grep="git-subtree-dir: $dir$" $1)" ]]
+ then
+ return 0
+ fi
+ fi
+ return 1
+}
+
# Usage: process_split_commit REV PARENTS
process_split_commit () {
assert test $# = 2
local rev="$1"
local parents="$2"
+ if should_ignore_subtree_commit $rev
+ then
+ return
+ fi
+
if test $indent -eq 0
then
revcount=$(($revcount + 1))