diff mbox series

[uci] cli: drop redundant uci_add_delta_path() call for -P

Message ID 20220816100851.3367-1-zajec5@gmail.com
State Accepted
Delegated to: Rafał Miłecki
Headers show
Series [uci] cli: drop redundant uci_add_delta_path() call for -P | expand

Commit Message

Rafał Miłecki Aug. 16, 2022, 10:08 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

savedir is always present in the list of delta paths. It's guaranteed by
1. uci_alloc_context() which sets defaults
2. uci_set_savedir() which allows changing savedir

Calling uci_add_delta_path() with ctx->savedir argument seems to always

Fixes: 2b4872345ab2b ("make use of the history path feature in the cli")
Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
 cli.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series


diff --git a/cli.c b/cli.c
index 2fce39d..b4c4f95 100644
--- a/cli.c
+++ b/cli.c
@@ -748,7 +748,6 @@  int main(int argc, char **argv)
 				uci_add_delta_path(ctx, optarg);
 			case 'P':
-				uci_add_delta_path(ctx, ctx->savedir);
 				uci_set_savedir(ctx, optarg);
 				flags |= CLI_FLAG_NOCOMMIT;