#!/usr/bin/env bash

set -xeu

mkdir testdir
cd testdir

git init remotedir
(
	cd remotedir
	git commit --allow-empty -m 'Initial commit'
	git branch deleteme
)

remotepath="$(pwd)/remotedir"

git push --delete "$remotepath" deleteme || echo 'Expected remote branch deletion failed'

git init pointlessrepo
(
	cd pointlessrepo
	git push --delete "$remotepath" deleteme && echo 'But it works here'
)
