...
This commit is contained in:
@@ -22,8 +22,8 @@ pub mut:
|
||||
recursive bool
|
||||
pull bool
|
||||
reload bool // means reload the info into the cache
|
||||
script bool = true // run non interactive
|
||||
reset bool = true // means we will lose changes (only relevant for clone, pull)
|
||||
script bool // run non interactive
|
||||
reset bool // means we will lose changes (only relevant for clone, pull)
|
||||
}
|
||||
|
||||
// do group actions on repo
|
||||
@@ -38,14 +38,12 @@ pub mut:
|
||||
// url string
|
||||
// pull bool
|
||||
// reload bool //means reload the info into the cache
|
||||
// script bool = true // run non interactive
|
||||
// reset bool = true // means we will lose changes (only relevant for clone, pull)
|
||||
// script bool // run non interactive
|
||||
// reset bool// means we will lose changes (only relevant for clone, pull)
|
||||
//```
|
||||
pub fn (mut gs GitStructure) do(args_ ReposActionsArgs) !string {
|
||||
mut args := args_
|
||||
console.print_debug('git do ${args.cmd}')
|
||||
// println(args)
|
||||
// $dbg;
|
||||
|
||||
if args.path.len > 0 && args.url.len > 0 {
|
||||
panic('bug')
|
||||
@@ -99,7 +97,9 @@ pub fn (mut gs GitStructure) do(args_ ReposActionsArgs) !string {
|
||||
provider: args.provider
|
||||
)!
|
||||
|
||||
if repos.len < 4 || args.cmd in 'pull,push,commit,delete'.split(',') {
|
||||
// println(repos.map(it.name))
|
||||
|
||||
if repos.len < 4 || args.cmd in 'pull,push,commit'.split(',') {
|
||||
args.reload = true
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ pub fn (mut repo GitRepo) status_update(args StatusUpdateArgs) ! {
|
||||
}
|
||||
|
||||
if args.reset || repo.last_load == 0 {
|
||||
// console.print_debug('${repo.name} : Cache get')
|
||||
// console.print_debug('${repo.name} : Cache Get')
|
||||
repo.cache_get()!
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ pub fn (mut repo GitRepo) status_update(args StatusUpdateArgs) ! {
|
||||
// Decide if a full load is needed.
|
||||
if args.reset || repo.last_load == 0
|
||||
|| current_time - repo.last_load >= repo.config.remote_check_period {
|
||||
// console.print_debug("reload ${repo.name}:\n args reset:${args.reset}\n lastload:${repo.last_load}\n currtime-lastload:${current_time- repo.last_load}\n period:${repo.config.remote_check_period}")
|
||||
// $dbg;
|
||||
repo.load_internal() or {
|
||||
// Persist the error state to the cache
|
||||
console.print_stderr('Failed to load repository ${repo.name} at ${repo.path()}: ${err}')
|
||||
@@ -51,7 +53,8 @@ fn (mut repo GitRepo) load_internal() ! {
|
||||
|
||||
repo.exec('fetch --all') or {
|
||||
repo.status.error = 'Failed to fetch updates: ${err}'
|
||||
return error('Failed to fetch updates for ${repo.name} at ${repo.path()}: ${err}. Please check network connection and repository access.')
|
||||
console.print_stderr('Failed to fetch updates for ${repo.name} at ${repo.path()}: ${err}. \nPlease check git repo source, network connection and repository access.')
|
||||
return
|
||||
}
|
||||
repo.load_branches()!
|
||||
repo.load_tags()!
|
||||
|
||||
Reference in New Issue
Block a user