Commit 40f508c2 authored by Brad King's avatar Brad King

git-gerrit-push: Fetch 'master' before checking refspecs

Fetch 'master' before deciding if there are no refspecs because later
changes may use 'master' to compute more refspecs.
parent 30ff0dc2
......@@ -54,17 +54,17 @@ if test -z "$no_topic"; then
refspecs="HEAD:refs/for/master/$topic $refspecs"
fi
# Fetch the current upstream master branch head.
# This helps computation of a minimal pack to push.
echo "Fetching $remote master"
fetch_out=$(git fetch "$remote" master 2>&1) || die "$fetch_out"
# Exit early if we have nothing to push.
if test -z "$refspecs"; then
echo 'Nothing to push!'
exit 0
fi
# Fetch the current upstream master branch head.
# This helps the computation of a minimal pack to push.
echo "Fetching $remote master"
fetch_out=$(git fetch "$remote" master 2>&1) || die "$fetch_out"
# Push. Save output and exit code.
echo "Pushing to $remote"
push_stdout=$(git push --porcelain $dry_run "$remote" $refspecs); push_exit=$?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment