Permalink
Browse files

Merge commit '22f6cb87f36144fd66881ab520e8a2024d6b5115' into config

  • Loading branch information...
2 parents 9da7466 + 22f6cb8 commit 378960589abddff72c7ad0c0e192f39239514897 @helmo helmo committed Mar 22, 2012
Showing with 19 additions and 9 deletions.
  1. +19 −9 git-subtree.sh
View
@@ -689,21 +689,31 @@ cmd_merge()
cmd_pull()
{
- ensure_clean
- git fetch "$@" || exit $?
- revs=FETCH_HEAD
- set -- $revs
- cmd_merge "$@"
+ if [ $# -ne 1 ]; then
+ die "You must provide <branch>"
+ fi
+ if [ -e "$dir" ]; then
+ ensure_clean
+ repository=$(git config -f .gittrees subtree.$prefix.url)
+ refspec=$1
+ git fetch $repository $refspec || exit $?
+ echo "git fetch using: " $repository $refspec
+ revs=FETCH_HEAD
+ set -- $revs
+ cmd_merge "$@"
+ else
+ die "'$dir' must already exist. Try 'git subtree add'."
+ fi
}
cmd_push()
{
- if [ $# -ne 2 ]; then
- die "You must provide <repository> <refspec>"
+ if [ $# -ne 1 ]; then
+ die "You must provide <branch>"
fi
if [ -e "$dir" ]; then
- repository=$1
- refspec=$2
+ repository=$(git config -f .gittrees subtree.$prefix.url)
+ refspec=$1
echo "git push using: " $repository $refspec
git push $repository $(git subtree split --prefix=$prefix):refs/heads/$refspec
else

0 comments on commit 3789605

Please sign in to comment.