t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync
[gitweb.git] / t / t5510-fetch.sh
index 5d4581dac84f0688389ca96ba139518336b78dba..5acd753dcff6b8a0e908b82dc86295a7727fb4b4 100755 (executable)
@@ -301,7 +301,7 @@ test_expect_success 'fetch via rsync' '
        mkdir rsynced &&
        (cd rsynced &&
         git init --bare &&
-        git fetch "rsync:$(pwd)/../.git" master:refs/heads/master &&
+        git fetch "rsync:../.git" master:refs/heads/master &&
         git gc --prune &&
         test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
         git fsck --full)
@@ -312,7 +312,7 @@ test_expect_success 'push via rsync' '
        (cd rsynced2 &&
         git init) &&
        (cd rsynced &&
-        git push "rsync:$(pwd)/../rsynced2/.git" master) &&
+        git push "rsync:../rsynced2/.git" master) &&
        (cd rsynced2 &&
         git gc --prune &&
         test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
@@ -323,7 +323,7 @@ test_expect_success 'push via rsync' '
        mkdir rsynced3 &&
        (cd rsynced3 &&
         git init) &&
-       git push --all "rsync:$(pwd)/rsynced3/.git" &&
+       git push --all "rsync:rsynced3/.git" &&
        (cd rsynced3 &&
         test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
         git fsck --full)
@@ -614,4 +614,41 @@ test_expect_success 'all boundary commits are excluded' '
        test_bundle_object_count .git/objects/pack/pack-${pack##pack    }.pack 3
 '
 
+test_expect_success 'fetch --prune prints the remotes url' '
+       git branch goodbye &&
+       git clone . only-prunes &&
+       git branch -D goodbye &&
+       (
+               cd only-prunes &&
+               git fetch --prune origin 2>&1 | head -n1 >../actual
+       ) &&
+       echo "From ${D}/." >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'branchname D/F conflict resolved by --prune' '
+       git branch dir/file &&
+       git clone . prune-df-conflict &&
+       git branch -D dir/file &&
+       git branch dir &&
+       (
+               cd prune-df-conflict &&
+               git fetch --prune &&
+               git rev-parse origin/dir >../actual
+       ) &&
+       git rev-parse dir >expect &&
+       test_cmp expect actual
+'
+
+test_expect_success 'fetching a one-level ref works' '
+       test_commit extra &&
+       git reset --hard HEAD^ &&
+       git update-ref refs/foo extra &&
+       git init one-level &&
+       (
+               cd one-level &&
+               git fetch .. HEAD refs/foo
+       )
+'
+
 test_done