Skip to contentSkip to conversation

t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync

PATCH In review Sebastian Schuberth 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t5510: Do not use $(pwd) when fetching / pushing / pulling via rsync

On MINGW, "pwd" is defined as "pwd -W" in test-lib.sh. This usually is the right thing, but the absolute Windows path with a colon confuses rsync. We could use $PWD in this case to work around the issue, but in fact there is no need to use an absolute path in the first place, so get rid of it.

This was discovered in the context of the mingwGitDevEnv project and only did not surface before with msysgit because the latter does not ship rsync.

---
 t/t5510-fetch.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t5510-fetch.sh +3 -3
index ab28594..5acd753 100755
@@ -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)
Signature · 1 line
1.8.5.2.msysgit.0
#1 lore raw

Hi Sebastian,

Quoted 8 lines · Sebastian Schuberth

On MINGW, "pwd" is defined as "pwd -W" in test-lib.sh. This usually is the right thing, but the absolute Windows path with a colon confuses rsync. We could use $PWD in this case to work around the issue, but in fact there is no need to use an absolute path in the first place, so get rid of it.

This was discovered in the context of the mingwGitDevEnv project and only did not surface before with msysgit because the latter does not ship rsync.

ACK

Ciao,
Dscho

#2 lore raw
Quoted 9 lines · Johannes Schindelin

Hi Sebastian,

Quoted 5 lines · Sebastian Schuberth

On MINGW, "pwd" is defined as "pwd -W" in test-lib.sh. This usually is the right thing, but the absolute Windows path with a colon confuses rsync. We could use $PWD in this case to work around the issue, but in fact there is no need to use an absolute path in the first place, so get rid of it.

Quoted 8 lines
Quoted 3 lines

This was discovered in the context of the mingwGitDevEnv project and only did not surface before with msysgit because the latter does not ship rsync.

ACK

Ciao,
Dscho

Thanks.