Skip to content

Commit 8dc3240

Browse files
LukeShugitster
authored andcommitted
subtree: drop support for git < 1.7
Suport for Git versions older than 1.7.0 (older than February 2010) was nice to have when git-subtree lived out-of-tree. But now that it lives in git.git, it's not necessary to keep around. While it's technically in contrib, with the standard 'git' packages for common systems (including Arch Linux and macOS) including git-subtree, it seems vanishingly likely to me that people are separately installing git-subtree from git.git alongside an older 'git' install (although it also seems vanishingly likely that people are still using >11 year old git installs). Not that there's much reason to remove it either, it's not much code, and none of my changes depend on a newer git (to my knowledge, anyway; I'm not actually testing against older git). I just figure it's an easy piece of fat to trim, in the journey to making the whole thing easier to hack on. "Ignore space change" is probably helpful when viewing this diff. Signed-off-by: Luke Shumaker <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d2f0f81 commit 8dc3240

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -852,23 +852,12 @@ cmd_merge () {
852852
rev="$new"
853853
fi
854854

855-
version=$(git version)
856-
if test "$version" \< "git version 1.7"
855+
if test -n "$message"
857856
then
858-
if test -n "$message"
859-
then
860-
git merge -s subtree --message="$message" "$rev"
861-
else
862-
git merge -s subtree "$rev"
863-
fi
857+
git merge -Xsubtree="$prefix" \
858+
--message="$message" "$rev"
864859
else
865-
if test -n "$message"
866-
then
867-
git merge -Xsubtree="$prefix" \
868-
--message="$message" "$rev"
869-
else
870-
git merge -Xsubtree="$prefix" $rev
871-
fi
860+
git merge -Xsubtree="$prefix" $rev
872861
fi
873862
}
874863

0 commit comments

Comments
 (0)