From: Marc Branchaud <marcn...@xiplink.com>

Signed-off-by: Marc Branchaud <marcn...@xiplink.com>
---
 t/t5510-fetch.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index d7a19a1..8ecd996 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -69,6 +69,23 @@ test_expect_success "fetch test" '
        test "z$mine" = "z$his"
 '
 
+test_expect_success "fetch test detached HEAD uses default remote" '
+       cd "$D" &&
+       git clone -o foo . default-remote &&
+       git checkout -b detached &&
+       test_commit update1 &&
+       (
+               cd default-remote &&
+               git checkout HEAD@{0} &&
+               git fetch &&
+               test -f .git/refs/remotes/foo/detached &&
+               mine=`git rev-parse refs/remotes/foo/detached` &&
+               his=`cd .. && git rev-parse refs/heads/detached` &&
+               test "z$mine" = "z$his"
+       ) &&
+       git checkout master
+'
+
 test_expect_success "fetch test for-merge" '
        cd "$D" &&
        cd three &&
-- 
1.7.11.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to