Skip to content

Commit

Permalink
Allow git-retrack to accept only one argument or no arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiegley committed Feb 9, 2009
1 parent 5540b5f commit e6e6251
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-retrack
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

branch=$(git rev-parse --symbolic-full-name HEAD | sed 's/refs\/heads\///')

git remote add -f $1 "$2" || echo But that\'s perfectly OK.
if [ -n "$2" ]; then
git remote add -f $1 "$2" || echo But that\'s perfectly OK.
fi

git config branch.$branch.remote "$1"
git config branch.$branch.merge "refs/heads/${3:-$branch}"

0 comments on commit e6e6251

Please sign in to comment.