aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-21 14:55:02 -0800
committerJunio C Hamano <gitster@pobox.com>2016-12-21 14:55:02 -0800
commitfe050334074c5132d01e1df2c1b9a82c9b8d394c (patch)
treea5d4136c6aa15eae56ff19c3fffb94acad289757 /t
parent1123026f0bf6cd6c63e0711ef19567e0048d0b6a (diff)
parent5e74824fac646e2ebe335a00bcecd91641a7f7ca (diff)
downloadgit-fe050334074c5132d01e1df2c1b9a82c9b8d394c.tar.gz
git-fe050334074c5132d01e1df2c1b9a82c9b8d394c.tar.xz
Merge branch 'jk/quote-env-path-list-component'
A recent update to receive-pack to make it easier to drop garbage objects made it clear that GIT_ALTERNATE_OBJECT_DIRECTORIES cannot have a pathname with a colon in it (no surprise!), and this in turn made it impossible to push into a repository at such a path. This has been fixed by introducing a quoting mechanism used when appending such a path to the colon-separated list. * jk/quote-env-path-list-component: t5615-alternate-env: double-quotes in file names do not work on Windows t5547-push-quarantine: run the path separator test on Windows, too tmp-objdir: quote paths we add to alternates alternates: accept double-quoted paths
Diffstat (limited to 't')
-rwxr-xr-xt/t5547-push-quarantine.sh25
-rwxr-xr-xt/t5615-alternate-env.sh18
2 files changed, 43 insertions, 0 deletions
diff --git a/t/t5547-push-quarantine.sh b/t/t5547-push-quarantine.sh
index 1e5d32d06..af9fcd833 100755
--- a/t/t5547-push-quarantine.sh
+++ b/t/t5547-push-quarantine.sh
@@ -33,4 +33,29 @@ test_expect_success 'rejected objects are removed' '
test_cmp expect actual
'
+test_expect_success 'push to repo path with path separator (colon)' '
+ # The interesting failure case here is when the
+ # receiving end cannot access its original object directory,
+ # so make it likely for us to generate a delta by having
+ # a non-trivial file with multiple versions.
+
+ test-genrandom foo 4096 >file.bin &&
+ git add file.bin &&
+ git commit -m bin &&
+
+ if test_have_prereq MINGW
+ then
+ pathsep=";"
+ else
+ pathsep=":"
+ fi &&
+ git clone --bare . "xxx${pathsep}yyy.git" &&
+
+ echo change >>file.bin &&
+ git commit -am change &&
+ # Note that we have to use the full path here, or it gets confused
+ # with the ssh host:path syntax.
+ git push "$(pwd)/xxx${pathsep}yyy.git" HEAD
+'
+
test_done
diff --git a/t/t5615-alternate-env.sh b/t/t5615-alternate-env.sh
index eec4137ca..26ebb0375 100755
--- a/t/t5615-alternate-env.sh
+++ b/t/t5615-alternate-env.sh
@@ -68,4 +68,22 @@ test_expect_success 'access alternate via relative path (subdir)' '
EOF
'
+# set variables outside test to avoid quote insanity; the \057 is '/',
+# which doesn't need quoting, but just confirms that de-quoting
+# is working.
+quoted='"one.git\057objects"'
+unquoted='two.git/objects'
+test_expect_success 'mix of quoted and unquoted alternates' '
+ check_obj "$quoted:$unquoted" <<-EOF
+ $one blob
+ $two blob
+'
+
+test_expect_success !MINGW 'broken quoting falls back to interpreting raw' '
+ mv one.git \"one.git &&
+ check_obj \"one.git/objects <<-EOF
+ $one blob
+ EOF
+'
+
test_done