Files
git/builtin
Johannes Schindelin ce83eadd9a real_pathdup(): fix callsites that wanted it to die on error
In 4ac9006f83 (real_path: have callers use real_pathdup and
strbuf_realpath, 2016-12-12), we changed the xstrdup(real_path())
pattern to use real_pathdup() directly.

The problem with this change is that real_path() calls
strbuf_realpath() with die_on_error = 1 while real_pathdup() calls
it with die_on_error = 0. Meaning that in cases where real_path()
causes Git to die() with an error message, real_pathdup() is silent
and returns NULL instead.

The callers, however, are ill-prepared for that change, as they expect
the return value to be non-NULL (and otherwise the function died
with an appropriate error message).

Fix this by extending real_pathdup()'s signature to accept the
die_on_error flag and simply pass it through to strbuf_realpath(),
and then adjust all callers after a careful audit whether they would
handle NULLs well.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-08 14:38:41 -08:00
..
2016-12-21 14:55:01 -08:00
2016-11-22 13:55:20 -08:00
2017-02-02 13:36:55 -08:00
2016-09-29 15:42:18 -07:00
2017-01-30 14:17:00 -08:00
2017-01-30 14:17:00 -08:00
2016-09-29 15:42:18 -07:00
2016-10-10 14:03:50 -07:00
2016-09-26 16:09:17 -07:00
2016-11-22 13:13:16 -08:00
2016-12-27 00:11:41 -08:00
2016-09-29 15:42:18 -07:00
2017-01-18 15:12:15 -08:00
2016-09-29 15:42:18 -07:00
2017-01-31 13:14:56 -08:00
2016-10-03 12:46:47 -07:00
2017-01-23 18:51:56 -08:00
2017-01-31 13:14:58 -08:00