chiark / gitweb /
Make sure $root_dir does not have a trailing slash
authorMatt McDonald <metzen@gmail.com>
Fri, 14 Nov 2008 00:15:37 +0000 (19:15 -0500)
committermartin f. krafft <madduck@madduck.net>
Fri, 14 Nov 2008 06:13:43 +0000 (07:13 +0100)
commit4922baa85708a319708f8318d83403eea3c6972a
tree817884c52588692954ef34acc0ec93303dcbc1f1
parent58a8b91288860f74260eab41ca0c0333519f7773
Make sure $root_dir does not have a trailing slash

This adds support for using 'tg create' from within a subdirectory.

Apparently, git doesn't seem a do a good job of normalizing paths.
When topgit tries to add a new .topdeps file in a newly created
branch, git bails out with:

$ tg create new-branch
tg: Automatically marking dependency on old-branch
tg: Creating new-branch base from old-branch...
Switched to a new branch "new-branch"
(here, tg tries to do:  git add ../../..//.topdeps)

fatal: pathspec '/.topdeps' did not match any files

Since $root_dir is used everywhere like: "$root_dir/.topdeps", this
patch tries to make sure that $root_dir never has the trailing slash
so it always produces safe paths.

Signed-off-by: martin f. krafft <madduck@madduck.net>
tg.sh