git-backup 0.3.0 → 0.3.1
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/bin/git-backup +0 -2
- data/lib/git-backup.rb +6 -10
- data/lib/git-backup/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2622fbd8387f9a63174888be34e22c41bcdab996fb93c2d7680a8fc19889c56e
|
4
|
+
data.tar.gz: 22d056bf7172e5b28af692dac5805ef0cdcfe2413d4088581ba0bceb56878622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13a8fcf6c5b63004bd191520fbba921d2b7c782f960f6d3a6b86667cd102bac62bb3c49df43efa5707356f3c017db8f856b3a4b99e87383091288f5a2b7c49a0
|
7
|
+
data.tar.gz: 8897c7f624ff23969d7f9b527a658ecfd8323dc151aca337369c13699ef6c6b84e5c9c1a848ddb293bd466fd848602d614b3e9a51a5d48aa7282fccd568af1f8
|
data/bin/git-backup
CHANGED
data/lib/git-backup.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require "git-backup/version"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
number_of_existing_backups = local_branches.count { |branch| branch =~ /backup\/#{Regexp.quote(current_branch)}-\d+/ }
|
8
|
-
backup_branch_name = "backup/#{current_branch}-#{number_of_existing_backups + 1}"
|
3
|
+
current_branch = `git rev-parse --abbrev-ref HEAD`.strip
|
4
|
+
local_branches = `git branch`.delete(" ").split("\n")
|
5
|
+
number_of_existing_backups = local_branches.count { |branch| branch =~ /backup\/#{Regexp.quote(current_branch)}-\d+/ }
|
6
|
+
backup_branch_name = "backup/#{current_branch}-#{number_of_existing_backups + 1}"
|
9
7
|
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
end
|
8
|
+
`git branch #{backup_branch_name}`
|
9
|
+
puts "Created branch #{backup_branch_name}."
|
data/lib/git-backup/version.rb
CHANGED