extract-repo 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/extract_repo.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a9293c9fcfc7ca1fa0e6c1b6ea98fc2f8a49b759cc10e6fdf51c88c50810a05
|
|
4
|
+
data.tar.gz: ce6a41d8871ae90bd0b11e2e9bb5db5d42cc4a5f1637269d90cf9b47484c318b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ebbb6934f7ba07f305efc9b5f619ba8e9693aec319e4a0575decd010b4122433e4151ec50c64004b38f344ddff4dbe1cbfb8ed9dbd44c8e2a6d833d47691603c
|
|
7
|
+
data.tar.gz: 72cdc37b3597fc725e6590a1e753e4db709f4e7453b740e204bb2a2eeaca9978fb839e74e5b08e9c797d471fd1e36d9a4f0b7e97b831f6715ac69db2a353bf7f
|
data/CHANGELOG.md
CHANGED
data/lib/extract_repo.rb
CHANGED
|
@@ -30,6 +30,7 @@ class ExtractRepo < Foobara::Command
|
|
|
30
30
|
determine_historic_paths
|
|
31
31
|
filter_repo
|
|
32
32
|
remove_replaces
|
|
33
|
+
change_to_main_if_needed
|
|
33
34
|
|
|
34
35
|
delete_extracted_paths if delete_extracted?
|
|
35
36
|
end
|
|
@@ -87,6 +88,20 @@ class ExtractRepo < Foobara::Command
|
|
|
87
88
|
end
|
|
88
89
|
end
|
|
89
90
|
|
|
91
|
+
def change_to_main_if_needed
|
|
92
|
+
unless current_branch == "main"
|
|
93
|
+
chdir output_path do
|
|
94
|
+
sh "git branch -m main"
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def current_branch
|
|
100
|
+
chdir output_path do
|
|
101
|
+
sh "git branch --show-current"
|
|
102
|
+
end.strip
|
|
103
|
+
end
|
|
104
|
+
|
|
90
105
|
def determine_paths
|
|
91
106
|
chdir output_path do
|
|
92
107
|
self.file_paths = []
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: extract-repo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '0'
|
|
82
82
|
requirements: []
|
|
83
|
-
rubygems_version: 4.0.
|
|
83
|
+
rubygems_version: 4.0.24
|
|
84
84
|
specification_version: 4
|
|
85
85
|
summary: Extract code from one repository into a new repository, preserving history
|
|
86
86
|
of the extracted files.
|