#1 Open

Bitbucket cannot automatically merge this request.

The commits that make up this pull request have been removed.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg merge 33bdef55a31c
hg commit -m 'Merged in issue_164 (pull request #1)'
  1. croach

This pull request fixes a bug in cdproject where it would error out if the project directory path had a space in it.

Comments (2)

  1. croach author

    Hi Doug,

    Two things. First, this problem is only a problem for the Z-shell (which I use as my main shell). It actually doesn't show up in the bash and korn shells at all.

    Second, I looked into adding a test and noticed that there was already one in test_project_cd.sh called test_space_in_path that does exactly what I need. The reason it didn't catch the problem was that when the typeset command in the cdproject call failed, it would actually exit back out of the test function completely bypassing the call to assert and making it appear as if the test executed properly. To remedy this I had to call the test code in a subshell to capture the success/failure of the call to cdproject. So now if we're testing in the z-shell, if the subshell exits with an error, we capture it and report appropriately, if, however, we're in one of the other shells, we manually capture the success/failure and return it from the subshell.

    It sounds a bit convoluted, but it works. Running the tests for all shells seems to work just fine now.

    Let me know if you have any questions or need more clarification of my explanation above. I've updated the pull request with the new test, so everything should be good to go.