Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: remove extra quotes in submodule export #63

Merged
merged 1 commit into from
Jan 24, 2017
Merged

git: remove extra quotes in submodule export #63

merged 1 commit into from
Jan 24, 2017

Conversation

dt
Copy link
Contributor

@dt dt commented Jan 21, 2017

on the cli, one uses the extra single quotes to ensure the whole cmd is passed as a single arg despite
containing spaces, but when passing args in a structured call like this, it isn't needed, and instead causes this error:

[ERROR]	Unable to export dependencies to vendor directory: Error while exporting submodule sources
[DEBUG]	Output was: Entering 'lightstep-tracer-common'
/.../git-submodule: line 428: git checkout-index -f -a --prefix="/.../vendor/github.com/lightstep/lightstep-tracer-go/$path": No such file or directory
Stopping at 'lightstep-tracer-common'; script returned non-zero status.

Fixes Masterminds/glide#745

on the cli, one uses the extra single quotes to ensure the whole cmd is passed as a single arg despite
containing spaces, but when passing args in a structured call like this, it isn't needed.

Fixes Masterminds/glide#745
@wpecker
Copy link

wpecker commented Jan 23, 2017

[INFO] --> Exporting github.com/Sirupsen/logrus
[ERROR] Export failed for github.com/oschwald/maxminddb-golang: Error while exporting submodule sources
[DEBUG] Output was: Entering 'test-data'
/usr/lib/git-core/git-submodule: 1: eval: git checkout-index -f -a --prefix="/tmp/glide-vendor772707223/vendor/github.com/oschwald/maxminddb-golang/$path": not found
Stopping at 'test-data'; script returned non-zero status.[DEBUG] Unlocking https-github.com-oschwald-maxminddb-golang

@mattfarina mattfarina merged commit 2449b6d into Masterminds:master Jan 24, 2017
@mattfarina
Copy link
Member

Thanks for the contribution.

@dt dt deleted the quotes branch January 24, 2017 15:55
@@ -385,7 +385,7 @@ func (s *GitRepo) ExportDir(dir string) error {
return NewLocalError("Unable to export source", err, string(out))
}
// and now, the horror of submodules
out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "'git checkout-index -f -a --prefix=\""+filepath.Join(dir, "$path")+"\"'")
out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git checkout-index -f -a --prefix=\""+filepath.Join(dir, "$path")+"/\"")
Copy link

@dmitshur dmitshur Jan 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, is the newly added / (forward slash) character at the end intentional?

I ask because the commit message only mentions removing single quotes, nothing about adding a slash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, yes, it is, I just forgot to mention it in the message / I probably should have included a test.

I found via experimentation that without it, the submodule's files end up prefixed and in the parent dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error while exporting submodule
4 participants