remote: die on config error when setting/adding branches
commitab5e4b67e14cbd09e74d3b19c0553a3716205c45
authorPatrick Steinhardt <ps@pks.im>
Mon, 22 Feb 2016 11:23:29 +0000 (22 12:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Feb 2016 18:23:53 +0000 (22 10:23 -0800)
tree19e413bdcc99240fc2ddf4e76742770cd3c79101
parent45ebdcc99a8d8e7c671eb1db1212d90f5f2db341
remote: die on config error when setting/adding branches

When we add or set new branches (e.g. by `git remote add -f` or
`git remote set-branches`) we do not check for error codes when
writing the branches to the configuration file. When persisting
the configuration failed we are left with a remote that has none
or not all of the branches that should have been set without
notifying the user.

Fix this issue by dying early on configuration error.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c