cristibalan / braid

Simple tool to help track vendor branches in a Git repository.
http://cristibalan.github.io/braid
MIT License
457 stars 54 forks source link

Braid: Shell error: fatal: 'master/braid/.any-dot-file' is not a valid remote name #85

Closed ekesken closed 5 years ago

ekesken commented 5 years ago

To repeat the problem:

mkdir test-braid
cd test-braid
git init
touch README && git add README
git commit  -m 'initial commit.'
braid add --verbose --path .travis.yml https://github.com/cristibalan/braid.git

Output:

Braid: Executing `git --version` in /private/tmp/test-braid
Braid: Executing `git rev-parse --is-inside-work-tree` in /private/tmp/test-braid
Braid: Executing `git rev-parse --show-prefix` in /private/tmp/test-braid
Braid: Executing `git status` in /private/tmp/test-braid
Braid: Executing `git rev-parse HEAD` in /private/tmp/test-braid
Braid: Executing `git add .braids.json` in /private/tmp/test-braid
Braid: Adding mirror of 'https://github.com/cristibalan/braid.git'.
Braid: Executing `git --version` in /private/tmp/test-braid
Braid: Executing `git rev-parse --is-inside-work-tree` in /private/tmp/test-braid
Braid: Executing `git rev-parse --show-prefix` in /private/tmp/test-braid
Braid: Executing `git config remote.master/braid/.travis.yml.url` in /private/tmp/test-braid
Braid: Setup: Creating remote for '.travis.yml'.
Braid: Executing `git remote add master/braid/.travis.yml /Users/erhan.kesken/.braid/cache/https___github.com_cristibalan_braid.git` in /private/tmp/test-braid
Braid: Shell error: fatal: 'master/braid/.travis.yml' is not a valid remote name
$ git version
git version 2.20.1 (Apple Git-117)
$ braid version
braid 1.1.2

So it's not possible to mirror any dot files using braid.

realityforge commented 5 years ago

I suspect that the problem is on this line and invalid . characters could probably be replaced with _ characters. If you have a chance to look into it and submit a PR, that would be great