Skip to contentSkip to conversation

t5580: verify that alternates can be UNC paths

PATCH In review Johannes Schindelin via GitGitGadget 3 participants 4 messages Feb 25, 2019 – May 7, 2019

lore
Share & tools
lore
#0 lore raw

cover t5580: verify that alternates can be UNC paths

This was fixed in git.git's master some time ago, unfortunately not upstreamed from Git for Windows' patch thicket (my fault, or better put: the fault of the twenty-four hour days not being longer). We carried a regression test on top of the fix, and I can at least contribute that.

Johannes Schindelin (1):
t5580: verify that alternates can be UNC paths

 t/t5580-clone-push-unc.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

base-commit: 8104ec994ea3849a968b4667d072fedd1e688642
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-140%2Fdscho%2Ftest-unc-alternates-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-140/dscho/test-unc-alternates-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/140

Signature · 1 line
gitgitgadget
#1 lore raw

PATCH 1/1 t5580: verify that alternates can be UNC paths

From: Johannes Schindelin <[email protected]>

On Windows, UNC paths are a very convenient way to share data, and alternates are all about sharing data.

We fixed a bug where alternates specifying UNC paths were not handled properly, and it is high time that we add a regression test to ensure that this bug is not reintroduced.

---
 t/t5580-clone-push-unc.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
t/t5580-clone-push-unc.sh +12 -0
index 217adf3a63..b3c8a92450 100755
@@ -62,4 +62,16 @@ test_expect_success MINGW 'remote nick cannot contain backslashes' '
 	test_i18ngrep ! "unable to access" err
 '
 
+test_expect_success 'unc alternates' '
+	tree="$(git rev-parse HEAD:)" &&
+	mkdir test-unc-alternate &&
+	(
+		cd test-unc-alternate &&
+		git init &&
+		test_must_fail git show $tree &&
+		echo "$UNCPATH/.git/objects" >.git/objects/info/alternates &&
+		git show $tree
+	)
+'
+
 test_done
Signature · 1 line
gitgitgadget
#2 lore raw

Hi Junio,

gentle ping: this patch was not picked up yet, although it should be pretty uncontroversial.

Ciao,
Dscho

Quoted 39 lines · Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

On Windows, UNC paths are a very convenient way to share data, and alternates are all about sharing data.

We fixed a bug where alternates specifying UNC paths were not handled properly, and it is high time that we add a regression test to ensure that this bug is not reintroduced.

---
 t/t5580-clone-push-unc.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
t/t5580-clone-push-unc.sh +12 -1
index 217adf3a63..b3c8a92450 100755
@@ -62,4 +62,16 @@ test_expect_success MINGW 'remote nick cannot contain backslashes' '
 	test_i18ngrep ! "unable to access" err
 '
 
+test_expect_success 'unc alternates' '
+	tree="$(git rev-parse HEAD:)" &&
+	mkdir test-unc-alternate &&
+	(
+		cd test-unc-alternate &&
+		git init &&
+		test_must_fail git show $tree &&
+		echo "$UNCPATH/.git/objects" >.git/objects/info/alternates &&
+		git show $tree
+	)
+'
+
 test_done
--

gitgitgadget

#3 lore raw
Quoted 4 lines · Johannes Schindelin

Hi Junio,

gentle ping: this patch was not picked up yet, although it should be pretty uncontroversial.

Thanks. It does look it fell through the cracks without sound. Will pick it up.