summaryrefslogtreecommitdiffstats
path: root/t/t1400-update-ref.sh
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2017-02-21 02:10:33 +0100
committerJunio C Hamano <gitster@pobox.com>2017-02-21 07:04:47 +0100
commitde922669ab0508109cdb5672e5515f7524e3ccf8 (patch)
treee2c422d531bba40feb3940d2c552ab6d4cc45e3a /t/t1400-update-ref.sh
parentdelete_ref: accept a reflog message argument (diff)
downloadgit-de922669ab0508109cdb5672e5515f7524e3ccf8.tar.xz
git-de922669ab0508109cdb5672e5515f7524e3ccf8.zip
update-ref: pass reflog message to delete_ref()
Now that delete_ref() accepts a reflog message, pass the user-provided message to delete_ref() rather than silently dropping it. Signed-off-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1400-update-ref.sh')
-rwxr-xr-xt/t1400-update-ref.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index b0ffc0b573..6e112fb5f9 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -85,6 +85,24 @@ test_expect_success "delete $m (by HEAD)" '
'
rm -f .git/$m
+test_expect_success "deleting current branch adds message to HEAD's log" '
+ git update-ref $m $A &&
+ git symbolic-ref HEAD $m &&
+ git update-ref -m delete-$m -d $m &&
+ ! test -f .git/$m &&
+ grep "delete-$m$" .git/logs/HEAD
+'
+rm -f .git/$m
+
+test_expect_success "deleting by HEAD adds message to HEAD's log" '
+ git update-ref $m $A &&
+ git symbolic-ref HEAD $m &&
+ git update-ref -m delete-by-head -d HEAD &&
+ ! test -f .git/$m &&
+ grep "delete-by-head$" .git/logs/HEAD
+'
+rm -f .git/$m
+
test_expect_success 'update-ref does not create reflogs by default' '
test_when_finished "git update-ref -d $outside" &&
git update-ref $outside $A &&