Code

Merge branch 'maint-1.5.6' into maint-1.6.0
[git.git] / t / t5510-fetch.sh
index 13d1d826c20293c26c739c70c0a36ed48bbb41d1..52094e78dcd63cd7dc1ce166450c403fc32efbac 100755 (executable)
@@ -111,7 +111,7 @@ test_expect_success 'fetch must not resolve short tag name' '
 test_expect_success 'fetch must not resolve short remote name' '
 
        cd "$D" &&
-       git-update-ref refs/remotes/six/HEAD HEAD
+       git update-ref refs/remotes/six/HEAD HEAD
 
        mkdir six &&
        cd six &&
@@ -303,4 +303,16 @@ test_expect_success 'pushing nonexistent branch by mistake should not segv' '
 
 '
 
+test_expect_success 'refuse to fetch into the current branch' '
+
+       test_must_fail git fetch . side:master
+
+'
+
+test_expect_success 'fetch into the current branch with --update-head-ok' '
+
+       git fetch --update-head-ok . side:master
+
+'
+
 test_done