summaryrefslogtreecommitdiff
path: root/t/t5400-send-pack.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-24 08:26:49 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-24 11:59:05 (GMT)
commitd4f694ba89857a87e259557d0f236c761b4041ef (patch)
tree08453ccc3a39a74ad5e74ff4bf1cf13dd88b85c7 /t/t5400-send-pack.sh
parent634b8d05142a4812bf35fe8b14cc62c84494c78f (diff)
downloadgit-d4f694ba89857a87e259557d0f236c761b4041ef.zip
git-d4f694ba89857a87e259557d0f236c761b4041ef.tar.gz
git-d4f694ba89857a87e259557d0f236c761b4041ef.tar.bz2
Allow git push to delete remote ref.
This allows you to say git send-pack $URL :refs/heads/$branch to delete the named remote branch. The refspec $src:$dst means replace the destination ref with the object known as $src on the local side, so this is a natural extension to make an empty $src mean "No object" to delete the target. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t5400-send-pack.sh')
-rwxr-xr-xt/t5400-send-pack.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 8afb899..28744b3 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -64,6 +64,16 @@ test_expect_success \
cmp victim/.git/refs/heads/master .git/refs/heads/master
'
+test_expect_success \
+ 'push can be used to delete a ref' '
+ cd victim &&
+ git branch extra master &&
+ cd .. &&
+ test -f victim/.git/refs/heads/extra &&
+ git-send-pack ./victim/.git/ :extra master &&
+ ! test -f victim/.git/refs/heads/extra
+'
+
unset GIT_CONFIG GIT_CONFIG_LOCAL
HOME=`pwd`/no-such-directory
export HOME ;# this way we force the victim/.git/config to be used.