Skip to content

Commit

Permalink
Format stash branch names properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
qw3rtman committed Jul 4, 2016
1 parent 1a0ce5d commit 3024c23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-fire
Expand Up @@ -23,10 +23,12 @@ user_email() {
}

new_branch() {
echo "fire-$(current_branch)-$(user_email)-$(current_epoch)"
echo "fire-${1:-$(current_branch)}-$(user_email)-$(current_epoch)"
}

fire() {
initial_branch="$(current_branch)"

git checkout -b "$(new_branch)"

# cd to git root directory
Expand All @@ -47,7 +49,7 @@ fire() {
done

for sha in $(git rev-list -g stash); do
git push origin "$sha":refs/heads/stash_"$sha"
git push origin "$sha":refs/heads/"$(current_branch $initial_branch)"-stash-"$sha"
done

printf "\n\nLeave building!\n"
Expand Down

0 comments on commit 3024c23

Please sign in to comment.