@@ -598,7 +598,7 @@ function Plugin.new(spec)
598
598
is_local = spec .is_local or false , -- Development mode flag
599
599
is_lazy = spec .is_lazy or false , -- Whether to lazy load
600
600
local_path = nil , -- Local path to load
601
- branch = spec .branch , -- Git branch to use
601
+ remote_branch = spec ._branch , -- Git branch to use
602
602
603
603
-- States
604
604
status = STATUS .PENDING , -- Current plugin status
@@ -1005,7 +1005,7 @@ function Plugin:branch(branch_name)
1005
1005
type (branch_name ) == ' string' and branch_name ~= ' ' ,
1006
1006
' Branch name must be a non-empty string'
1007
1007
)
1008
- self .branch = branch_name
1008
+ self ._branch = branch_name
1009
1009
return self
1010
1010
end
1011
1011
@@ -1085,9 +1085,9 @@ function Plugin:install()
1085
1085
}
1086
1086
1087
1087
-- Add branch specification if provided
1088
- if self .branch then
1089
- table.insert (cmd , ' --branch=' .. self .branch )
1090
- M .log (' debug' , string.format (' Installing %s from branch: %s' , self .name , self .branch ))
1088
+ if self ._branch then
1089
+ table.insert (cmd , ' --branch=' .. self ._branch )
1090
+ M .log (' debug' , string.format (' Installing %s from branch: %s' , self .name , self ._branch ))
1091
1091
end
1092
1092
1093
1093
-- Add URL and path at the end
@@ -1096,7 +1096,7 @@ function Plugin:install()
1096
1096
1097
1097
-- Update status
1098
1098
self .status = STATUS .INSTALLING
1099
- local install_msg = self .branch and (' Installing from branch: ' .. self .branch )
1099
+ local install_msg = self ._branch and (' Installing from branch: ' .. self ._branch )
1100
1100
or ' Starting installation...'
1101
1101
ui :update_entry (self .name , self .status , install_msg )
1102
1102
@@ -1120,7 +1120,7 @@ function Plugin:install()
1120
1120
1121
1121
if result .success then
1122
1122
self .status = STATUS .INSTALLED
1123
- local success_msg = self .branch and (' Installed from branch: ' .. self .branch )
1123
+ local success_msg = self ._branch and (' Installed from branch: ' .. self ._branch )
1124
1124
or ' Installation complete'
1125
1125
ui :update_entry (self .name , self .status , success_msg )
1126
1126
@@ -1164,8 +1164,8 @@ function Plugin:has_updates()
1164
1164
}
1165
1165
1166
1166
-- If a specific branch is set, fetch that branch
1167
- if self .branch then
1168
- table.insert (fetch_cmd , self .branch .. ' :refs/remotes/origin/' .. self .branch )
1167
+ if self ._branch then
1168
+ table.insert (fetch_cmd , self ._branch .. ' :refs/remotes/origin/' .. self ._branch )
1169
1169
end
1170
1170
1171
1171
local result = Async .try_await (Async .system (fetch_cmd ))
@@ -1175,7 +1175,7 @@ function Plugin:has_updates()
1175
1175
end
1176
1176
1177
1177
-- Compare with the appropriate upstream
1178
- local upstream_ref = self .branch and ' @{upstream}' or ' @{upstream}'
1178
+ local upstream_ref = self ._branch and ' @{upstream}' or ' @{upstream}'
1179
1179
local rev_cmd = {
1180
1180
' git' ,
1181
1181
' -C' ,
@@ -1249,7 +1249,7 @@ function Plugin:update(skip_check)
1249
1249
1250
1250
if not has_updates then
1251
1251
self .status = STATUS .UPDATED
1252
- local up_to_date_msg = self .branch and (' Up to date on branch: ' .. self .branch )
1252
+ local up_to_date_msg = self ._branch and (' Up to date on branch: ' .. self ._branch )
1253
1253
or ' Already up to date'
1254
1254
ui :update_entry (self .name , self .status , up_to_date_msg )
1255
1255
callback (true , ' up_to_date' )
@@ -1259,17 +1259,17 @@ function Plugin:update(skip_check)
1259
1259
1260
1260
-- Update the plugin
1261
1261
self .status = STATUS .UPDATING
1262
- local updating_msg = self .branch and (' Updating branch: ' .. self .branch )
1262
+ local updating_msg = self ._branch and (' Updating branch: ' .. self ._branch )
1263
1263
or ' Starting update...'
1264
1264
ui :update_entry (self .name , self .status , updating_msg )
1265
1265
1266
1266
local path = self :get_path ()
1267
1267
local cmd = { ' git' , ' -C' , path , ' pull' , ' --progress' }
1268
1268
1269
1269
-- If specific branch is set, pull from that branch
1270
- if self .branch then
1270
+ if self ._branch then
1271
1271
table.insert (cmd , ' origin' )
1272
- table.insert (cmd , self .branch )
1272
+ table.insert (cmd , self ._branch )
1273
1273
end
1274
1274
1275
1275
-- Use our new Async.system wrapper
@@ -1298,13 +1298,13 @@ function Plugin:update(skip_check)
1298
1298
local commit_info = stdout :match (' ([a-f0-9]+)%.%.([a-f0-9]+)' )
1299
1299
1300
1300
if stdout :find (' Already up to date' ) then
1301
- update_info = self .branch and (' Already up to date on branch: ' .. self .branch )
1301
+ update_info = self ._branch and (' Already up to date on branch: ' .. self ._branch )
1302
1302
or ' Already up to date'
1303
1303
elseif commit_info then
1304
- local branch_info = self .branch and (' on branch: ' .. self .branch ) or ' '
1304
+ local branch_info = self ._branch and (' on branch: ' .. self ._branch ) or ' '
1305
1305
update_info = string.format (' Updated to %s%s' , commit_info , branch_info )
1306
- elseif self .branch then
1307
- update_info = ' Updated on branch: ' .. self .branch
1306
+ elseif self ._branch then
1307
+ update_info = ' Updated on branch: ' .. self ._branch
1308
1308
end
1309
1309
1310
1310
ui :update_entry (self .name , self .status , update_info )
@@ -1335,7 +1335,7 @@ function Plugin:install_with_retry()
1335
1335
end
1336
1336
1337
1337
self .status = STATUS .INSTALLING
1338
- local install_msg = self .branch and (' Installing from branch: ' .. self .branch )
1338
+ local install_msg = self ._branch and (' Installing from branch: ' .. self ._branch )
1339
1339
or ' Starting installation...'
1340
1340
ui :update_entry (self .name , self .status , install_msg )
1341
1341
@@ -1344,8 +1344,8 @@ function Plugin:install_with_retry()
1344
1344
local cmd = { ' git' , ' clone' , ' --progress' }
1345
1345
1346
1346
-- Add branch specification if provided
1347
- if self .branch then
1348
- table.insert (cmd , ' --branch=' .. self .branch )
1347
+ if self ._branch then
1348
+ table.insert (cmd , ' --branch=' .. self ._branch )
1349
1349
end
1350
1350
1351
1351
table.insert (cmd , url )
@@ -1374,7 +1374,7 @@ function Plugin:install_with_retry()
1374
1374
-- Handle result
1375
1375
if result .success then
1376
1376
self .status = STATUS .INSTALLED
1377
- local success_msg = self .branch and (' Installed from branch: ' .. self .branch )
1377
+ local success_msg = self ._branch and (' Installed from branch: ' .. self ._branch )
1378
1378
or ' Installation complete'
1379
1379
ui :update_entry (self .name , self .status , success_msg )
1380
1380
0 commit comments