Browse Source
On Cygwin, similar to Windows, "git push //server/share/repository" ought to mean a repository on a network share that can be accessed locally, but this did not work correctly due to stripping the double slashes at the beginning. This may need to be heavily tested before it gets unleashed to the wild, as the change is at a fairly low-level code and would affect not just the code to decide if the push destination is local. There may be unexpected fallouts in the path normalization. * tb/push-to-cygwin-unc-path: cygwin: allow pushing to UNC pathsmaint

5 changed files with 27 additions and 0 deletions
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
#include "../git-compat-util.h" |
||||
#include "../cache.h" |
||||
|
||||
int cygwin_offset_1st_component(const char *path) |
||||
{ |
||||
const char *pos = path; |
||||
/* unc paths */ |
||||
if (is_dir_sep(pos[0]) && is_dir_sep(pos[1])) { |
||||
/* skip server name */ |
||||
pos = strchr(pos + 2, '/'); |
||||
if (!pos) |
||||
return 0; /* Error: malformed unc path */ |
||||
|
||||
do { |
||||
pos++; |
||||
} while (*pos && pos[0] != '/'); |
||||
} |
||||
return pos + is_dir_sep(*pos) - path; |
||||
} |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
int cygwin_offset_1st_component(const char *path); |
||||
#define offset_1st_component cygwin_offset_1st_component |
Loading…
Reference in new issue