When adding or merging the first parameter might not be a commit, it can also 
be a tag SHA.
This needs to be fixed by using the underlying commit or the ancestor finding 
code will croak at split time


Signed-off-by: Jérémy Rosen <jeremy.ro...@openwide.fr>
---
 contrib/subtree/git-subtree.sh |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 8a23f58..8b9d114 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -531,7 +531,7 @@ cmd_add_repository()
 
 cmd_add_commit()
 {
-       revs=$(git rev-parse $default --revs-only "$@") || exit $?
+       revs=$(git rev-parse $default --revs-only "$1^{commit}") || exit $?
        set -- $revs
        rev="$1"
        
@@ -655,7 +655,7 @@ cmd_split()
 
 cmd_merge()
 {
-       revs=$(git rev-parse $default --revs-only "$@") || exit $?
+       revs=$(git rev-parse $default --revs-only "$1^{commit}") || exit $?
        ensure_clean
        
        set -- $revs
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to