mirror of
https://github.com/tj/git-extras.git
synced 2026-09-11 07:56:18 -04:00
git-rename-branch: Don't fail if remote doesn't exist
Allows the command to work correctly with local branches. Closes #535
This commit is contained in:
parent
2590998ee0
commit
7393fb41ed
|
|
@ -6,7 +6,7 @@ test -z $1 && echo "new branch name required." 1>&2 && exit 1
|
|||
|
||||
new_branch="$1"
|
||||
old_branch="${2-$(git symbolic-ref --short -q HEAD)}"
|
||||
remote=$(git config branch."$old_branch".remote)
|
||||
remote=$(git config branch."$old_branch".remote; true)
|
||||
|
||||
git branch -m "$old_branch" "$new_branch"
|
||||
# check if the branch is tracking a remote branch
|
||||
|
|
|
|||
Loading…
Reference in a new issue