summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c00d1d1)
raw | patch | inline | side by side (parent: c00d1d1)
author | Pelle Wessman <pelle@kodfabrik.se> | |
Fri, 7 May 2010 19:21:25 +0000 (21:21 +0200) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Fri, 7 May 2010 19:59:56 +0000 (15:59 -0400) |
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.
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.
git-subtree.sh | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index 501c6dc2f1a8e8a646f535074c8e95f7bc445439..b7c350107e6edc8032eba76d5d74e56628bffd82 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
debug "New squash commit: $new"
rev="$new"
fi
-
- if [ -n "$message" ]; then
- git merge -s subtree --message="$message" $rev
+
+ version=$(git version)
+ 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
- git merge -s subtree $rev
+ if [ -n "$message" ]; then
+ git merge -Xsubtree="$prefix" --message="$message" $rev
+ else
+ git merge -Xsubtree="$prefix" $rev
+ fi
fi
}