#!/bin/bash
set -xeuo pipefail
rm -rf /tmp/g1 /tmp/h1
git init /tmp/g1
hg init /tmp/h1
cd /tmp/g1
touch a
git add a
git commit -am a
FIRST=$(git rev-parse HEAD)
touch b
git add b
git commit -am b
SECOND=$(git rev-parse HEAD)
git push hg::/tmp/h1 $SECOND:refs/heads/master
git push hg::/tmp/h1 $FIRST:refs/heads/master
+ git push hg::/tmp/h1 4a530a3c7284686ff8d62d3f9b63cc9c7bea57f2:refs/heads/master
no changes found
2 local changesets published
To hg::/tmp/h1
! [remote rejected] 4a530a3c7284686ff8d62d3f9b63cc9c7bea57f2 -> master (unknown)
error: failed to push some refs to 'hg::/tmp/h1'