ingydotnet / git-subrepo

MIT License
3.27k stars 270 forks source link

GIT_SUBREPO_ROOT being duplicated when running tests #255

Open Aaron-Hartwig opened 7 years ago

Aaron-Hartwig commented 7 years ago

user@workstation ~/Documents/git-subrepo $ make test prove test/ test/branch-all.t ........... C:/Users/user/Documents/git-subrepo/.rc: line 21: cd: C:/Users//Documents/git-subrepo/C:/Users//Documents/git-subrepo: No such file or directory test/setup: line 17: bash+: No such file or directory test/branch-all.t ........... Dubious, test returned 1 (wstat 256, 0x100)

The contents of my .bashrc is the single line: source ~/Documents/git-subrepo/.rc

When I echo $PATH in a new shell, I can see that /c/Users/<user>/Documents/git-subrepo/lib has been added twice. Is this a bug from the bash script?

The terminal starts just fine, and the commands seem to be working. I just installed this today, so I haven't gotten to use it extensively, but the git subrepo version and git subrepo help commands run fine. I am using the Cmder emulator on Windows 7.

perlpunk commented 7 years ago

Seems like the test for an absolute path in line 19-20 is wrong for windows (path starts with C:/ at least when running the tests):

[[ $GIT_SUBREPO_ROOT =~ ^/ ]] ||
  GIT_SUBREPO_ROOT=$PWD/$GIT_SUBREPO_ROOT