Skip to contentSkip to conversation

t5501-*.sh: Fix url passed to clone in setup test

PATCH In review Ramsay Jones 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 t5501-*.sh: Fix url passed to clone in setup test

In particular, the url passed to git-clone has an extra '/' given after the 'file://' schema prefix, thus:

    git clone --reference=original "file:///$(pwd)/original one

Once the prefix is removed, the remainder of the url looks something like "//home/ramsay/git/t/...", which is then interpreted as an network path. This then results in a "Permission denied" error, like so:

ramsay $ ls //home
ls: cannot access //home: No such host or network path ramsay $ ls //home/ramsay
ls: cannot access //home/ramsay: Permission denied ramsay $

In order to fix the problem, we simply remove the extraneous '/' character from the url.

---
 t/t5501-fetch-push-alternates.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
t/t5501-fetch-push-alternates.sh +1 -1
index b5ced84..1bc57ac 100755
@@ -28,7 +28,7 @@ test_expect_success setup '
 		done
 	) &&
 	(
-		git clone --reference=original "file:///$(pwd)/original" one &&
+		git clone --reference=original "file://$(pwd)/original" one &&
 		cd one &&
 		echo Z >count &&
 		git add count &&
Signature · 1 line
1.7.7
#1 lore raw
Quoted 16 lines · Ramsay Jones

In particular, the url passed to git-clone has an extra '/' given after the 'file://' schema prefix, thus:

    git clone --reference=original "file:///$(pwd)/original one

Once the prefix is removed, the remainder of the url looks something like "//home/ramsay/git/t/...", which is then interpreted as an network path. This then results in a "Permission denied" error, like so:

ramsay $ ls //home
ls: cannot access //home: No such host or network path ramsay $ ls //home/ramsay
ls: cannot access //home/ramsay: Permission denied ramsay $

Quoted 5 lines

In order to fix the problem, we simply remove the extraneous '/' character from the url.

---

Thanks; obviously correct.

Quoted 16 lines
 t/t5501-fetch-push-alternates.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
t/t5501-fetch-push-alternates.sh +1 -1
index b5ced84..1bc57ac 100755
@@ -28,7 +28,7 @@ test_expect_success setup '
 		done
 	) &&
 	(
-		git clone --reference=original "file:///$(pwd)/original" one &&
+		git clone --reference=original "file://$(pwd)/original" one &&
 		cd one &&
 		echo Z >count &&
 		git add count &&