From f5598c88f47383eb7c87802b421ea87a10292593 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 13 Jul 2017 14:28:42 +0200 Subject: [PATCH 1/2] t5580: test cloning without file://, test fetching via UNC paths It gets a bit silly to add the commands to the name of the test script, so let's just rename it while we're testing more UNC stuff. Signed-off-by: Johannes Schindelin --- compat/mingw.c | 1 + t/{t5580-clone-push-unc.sh => t5580-unc-paths.sh} | 12 ++++++++++++ 2 files changed, 13 insertions(+) rename t/{t5580-clone-push-unc.sh => t5580-unc-paths.sh} (90%) diff --git a/compat/mingw.c b/compat/mingw.c index e07ec981d1..2526e0c5b1 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -8,6 +8,7 @@ #include "../cache.h" #include "win32/lazyload.h" #include "win32/exit-process.h" +#include "../config.h" #define HCAST(type, handle) ((type)(intptr_t)handle) diff --git a/t/t5580-clone-push-unc.sh b/t/t5580-unc-paths.sh similarity index 90% rename from t/t5580-clone-push-unc.sh rename to t/t5580-unc-paths.sh index 05977fdd7f..3af0997ce4 100755 --- a/t/t5580-clone-push-unc.sh +++ b/t/t5580-unc-paths.sh @@ -43,11 +43,23 @@ test_expect_success clone ' git clone "file://$UNCPATH" clone ' +test_expect_success 'clone without file://' ' + git clone "$UNCPATH" clone-without-file +' + test_expect_success 'clone with backslashed path' ' BACKSLASHED="$(echo "$UNCPATH" | tr / \\\\)" && git clone "$BACKSLASHED" backslashed ' +test_expect_success fetch ' + git init to-fetch && + ( + cd to-fetch && + git fetch "$UNCPATH" master + ) +' + test_expect_success push ' ( cd clone && From 2be7d89416e029388e2a2566b11cc7cd0bb289e5 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 13 Jul 2017 22:55:36 +0200 Subject: [PATCH 2/2] do_git_config_sequence(): fall back to git_dir if commondir is NULL Signed-off-by: Johannes Schindelin --- config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.c b/config.c index 99dd8e02ca..adcd2c2441 100644 --- a/config.c +++ b/config.c @@ -1532,6 +1532,8 @@ static int do_git_config_sequence(const struct config_options *opts, if (opts->commondir) repo_config = mkpathdup("%s/config", opts->commondir); + else if (opts->git_dir) + repo_config = mkpathdup("%s/config", opts->git_dir); else repo_config = NULL;