-
Notifications
You must be signed in to change notification settings - Fork 550
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
Protecting branches with a slash #34
Comments
Can you supply the exact command line invocation you're using? |
|
Ah, ok, I think I see the problem. It's to do with this line here: The code wasn't expecting branch names with a slash (because, like, obviously those are ug-lee). I'll release a fix within a couple of days, but for the time being, here's your workaround - don't refer to that ref by the 'slashed' name - use a simple-named ref instead:
|
Ok, thanks for the workaround! |
Eg this crashed: $ java -jar bfg-1.11.1.jar --strip-blobs-bigger-than 100K -p 'feature/worker-prototype' my-repo.git The code wasn't expecting branch names with a slash (because, like, obviously those are ug-lee) - and it's not possible to create filenames that contain slashes: #34
Eg this crashed: $ java -jar bfg-1.11.1.jar --strip-blobs-bigger-than 100K -p 'feature/worker-prototype' my-repo.git The code wasn't expecting branch names with a slash (because, like, obviously those are ug-lee) - and it's not possible to create filenames that contain slashes: rtyley/bfg-repo-cleaner#34
It doesn't work for me with version 2.14. I have to rename the branches that contain slashes. Maybe it is because I am using it on Windows ?
|
I'd like to protect the tip of a branch which has a slash in its name:
feature/worker-prototype
.When I run the BFG on the repository while protecting the branch, JGit doesn't like the "/" and throw an exception.
Exception in thread "main" java.lang.IllegalArgumentException: / is not permitted as a path 'segment' for this filesystem. Segment in question: 991564ae-feature/worker-prototype.csv. If you want to create a Path from a system dependent string then use fromString. If you want to create a child path use resolve instead of / to create the child path. It should be noted that the string after '/' must be a single segment but resolve accepts full strings. Examples: Path.fromString("c: \a\b") path / ("a/b/c", '/') path resolve "a\b\c" at scalax.file.FileSystem.checkSegmentForSeparators(FileSystem.scala:280) at scalax.file.defaultfs.DefaultPath.$div(DefaultPath.scala:44) at com.madgag.git.bfg.cleaner.CLIReporter$$anonfun$reportProtectedCommitsAndTheirDirt$1.apply(Reporter.scala:122) at com.madgag.git.bfg.cleaner.CLIReporter$$anonfun$reportProtectedCommitsAndTheirDirt$1.apply(Reporter.scala:108) at scala.collection.immutable.List.foreach(List.scala:318) at com.madgag.git.bfg.cleaner.CLIReporter.reportProtectedCommitsAndTheirDirt(Reporter.scala:107) at com.madgag.git.bfg.cleaner.CLIReporter.reportObjectProtection(Reporter.scala:80) at com.madgag.git.bfg.cleaner.RepoRewriter$.rewrite(RepoRewriter.scala:96) at com.madgag.git.bfg.cli.Main$$anonfun$1.apply(Main.scala:59) at com.madgag.git.bfg.cli.Main$$anonfun$1.apply(Main.scala:34) at scala.Option.map(Option.scala:145) at com.madgag.git.bfg.cli.Main$delayedInit$body.apply(Main.scala:33) at scala.Function0$class.apply$mcV$sp(Function0.scala:40) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.App$$anonfun$main$1.apply(App.scala:71) at scala.collection.immutable.List.foreach(List.scala:318) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32) at scala.App$class.main(App.scala:71) at com.madgag.git.bfg.cli.Main$.main(Main.scala:27) at com.madgag.git.bfg.cli.Main.main(Main.scala)
Using BFG 1.11. Is there a fix / an easy workaround?
The text was updated successfully, but these errors were encountered: