aircon 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d51871327109dc3145685c8ff1b808658592ebc527baaab88fc7d54d3a2b5d1
4
- data.tar.gz: 60ddec11a21faf68d0c8d43beae7a424d935e82df72c0be5e09ff90a2102829b
3
+ metadata.gz: b5b3b124b494117995209a018929128c6f19659813c182d8cf204a29b695bc97
4
+ data.tar.gz: ffd8e8323e460a77a007abe18f43cee07080b78156da9759fd3f22773310860c
5
5
  SHA512:
6
- metadata.gz: 23e48ab217b5c812dffac335ff9dbebb72233379dbf601fe86369e2fa38960b798d1bd325ddbde3164951927a798a60ca9c129aa87b49f2e2333cdafae5a9934
7
- data.tar.gz: 8d93936b25ce81e580a5741706cd3e7a6cd4ae1bc46776e6db1a25864a51ca2c08b42f33d8e583b84c05bd040c2e42fa646e3c7d03d486ef7723ca4ecfbae8b8
6
+ metadata.gz: 749d093f93485cbbc99b3280be49d8921049b5ad107ccc17170f6522d47eefe358bde6ba17afa74c270d289133feb47673486a4dc28e39f8f42fa614e9f9f5b4
7
+ data.tar.gz: '091c7ce2565eea7113f4c3d8263a0c31a72349e5c05ff681f373bd0c9e40b82feda3f031f507a5ec74304e40161891d98034f1a6b8167616f2dc031a03b41676'
@@ -170,14 +170,20 @@ module Aircon
170
170
  system("docker", "exec", container, "git", "config", "--global",
171
171
  "url.#{authed}.insteadOf", "git@github.com:")
172
172
  end
173
- # Check if branch exists on remote; if so, check it out, otherwise create new
174
- _, status = Open3.capture2("docker", "exec", container, "git", "ls-remote", "--heads", "origin", branch)
175
- if status.success? && !_.strip.empty?
176
- system("docker", "exec", container, "git", "fetch", "origin", branch)
177
- system("docker", "exec", container, "git", "checkout", "-b", branch, "origin/#{branch}")
178
- else
179
- system("docker", "exec", container, "git", "fetch", "origin", "main")
180
- system("docker", "exec", container, "git", "checkout", "-b", branch, "origin/main")
173
+ # Skip checkout if already on the target branch (host was on this branch)
174
+ current_branch, = Open3.capture2("docker", "exec", container, "git", "rev-parse", "--abbrev-ref", "HEAD")
175
+ if current_branch.strip != branch
176
+ # Check if branch exists on remote; if so, check it out, otherwise create new
177
+ _, status = Open3.capture2("docker", "exec", container, "git", "ls-remote", "--heads", "origin", branch)
178
+ if status.success? && !_.strip.empty?
179
+ system("docker", "exec", container, "git", "fetch", "origin", branch)
180
+ system("docker", "exec", container, "git", "checkout", "-f", "-b", branch, "origin/#{branch}")
181
+ system("docker", "exec", container, "git", "clean", "-fd")
182
+ else
183
+ system("docker", "exec", container, "git", "fetch", "origin", "main")
184
+ system("docker", "exec", container, "git", "checkout", "-f", "--no-track", "-b", branch, "origin/main")
185
+ system("docker", "exec", container, "git", "clean", "-fd")
186
+ end
181
187
  end
182
188
 
183
189
  # If you have the official anthropic marketplace plugin installed, it will always make a call to the anthropic github repo on claude startup. It uses SSH, but it should be https for universal compatibility since its a public repository.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aircon
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aircon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Nguyen