Skip to content

Commit ff73164

Browse files
committed
don't push the stashes if there isn't any
If you did a `git fire` in a repo without any stash you would get this error: ``` fatal: ambiguous argument 'stash': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' ```
1 parent f485fff commit ff73164

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

git-fire

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ fire() {
4848
git push --set-upstream "${remote}" "$(current_branch)" || true
4949
done
5050

51-
for sha in $(git rev-list -g stash); do
52-
git push origin "$sha":refs/heads/"$(current_branch $initial_branch)"-stash-"$sha"
53-
done
51+
if [[ $(git stash list) != '' ]]; then
52+
for sha in $(git rev-list -g stash); do
53+
git push origin "$sha":refs/heads/"$(current_branch $initial_branch)"-stash-"$sha"
54+
done
55+
fi
5456

5557
printf "\n\nLeave building!\n"
5658
}

0 commit comments

Comments
 (0)