mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 10:32:45 +08:00
parent
7e6baab153
commit
7517128b68
|
@ -346,11 +346,12 @@ void env_universal_t::generate_callbacks_and_update_exports(const var_table_t &n
|
|||
|
||||
bool old_exports = (existing != this->vars.end() && existing->second.exports());
|
||||
bool export_changed = (old_exports != new_entry.exports());
|
||||
if (export_changed) {
|
||||
bool value_changed = existing != this->vars.end() && existing->second != new_entry;
|
||||
if (export_changed || value_changed) {
|
||||
export_generation += 1;
|
||||
}
|
||||
if (existing == this->vars.end() || export_changed || existing->second != new_entry) {
|
||||
// Value has changed.
|
||||
if (existing == this->vars.end() || export_changed || value_changed) {
|
||||
// Value is set for the first time, or has changed.
|
||||
callbacks.push_back(callback_data_t(key, new_entry.as_string()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -649,4 +649,11 @@ test_ifforwhile_scope
|
|||
set -g status 5
|
||||
#CHECKERR: set: Tried to change the read-only variable 'status'
|
||||
|
||||
while set -e __fish_test_universal_exported_var
|
||||
end
|
||||
set -xU __fish_test_universal_exported_var 1
|
||||
$FISH -c 'set __fish_test_universal_exported_var 2'
|
||||
env | string match -e __fish_test_universal_exported_var
|
||||
#CHECK: __fish_test_universal_exported_var=2
|
||||
|
||||
true
|
||||
|
|
Loading…
Reference in New Issue
Block a user