mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
fix reflog failing to properly refresh
This commit is contained in:
parent
f4ddf2f0d4
commit
ce3bcfe37c
16 changed files with 1196 additions and 3 deletions
28
vendor/github.com/sanity-io/litter/util.go
generated
vendored
Normal file
28
vendor/github.com/sanity-io/litter/util.go
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
package litter
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
)
|
||||
|
||||
// deInterface returns values inside of non-nil interfaces when possible.
|
||||
// This is useful for data types like structs, arrays, slices, and maps which
|
||||
// can contain varying types packed inside an interface.
|
||||
func deInterface(v reflect.Value) reflect.Value {
|
||||
if v.Kind() == reflect.Interface && !v.IsNil() {
|
||||
v = v.Elem()
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func isPointerValue(v reflect.Value) bool {
|
||||
switch v.Kind() {
|
||||
case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func isZeroValue(v reflect.Value) bool {
|
||||
return (isPointerValue(v) && v.IsNil()) ||
|
||||
(v.IsValid() && v.CanInterface() && reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue