diff options
author | Jeff King <peff@peff.net> | 2017-01-13 12:54:10 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-15 15:59:02 -0800 |
commit | 0b20f1a26604a4f43f4728acc56c6ffc6a976220 (patch) | |
tree | 6ab32e3fd632bccfe69e2caf014e87ef8564e3a1 /builtin/merge-recursive.c | |
parent | Sync with maint-2.10 (diff) | |
download | tgif-0b20f1a26604a4f43f4728acc56c6ffc6a976220.tar.xz |
t1450: refactor loose-object removal
Commit 90cf590f5 (fsck: optionally show more helpful info
for broken links, 2016-07-17) added a remove_loose_object()
helper, but we already had a remove_object() helper that did
the same thing. Let's combine these into one.
The implementations had a few subtle differences, so I've
tried to take the best of both:
- the original used "sed", but the newer version avoids
spawning an extra process
- the original processed "$*", which was nonsense, as it
assumed only a single sha1. Use "$1" to make that more
clear.
- the newer version ran an extra rev-parse, but it was not
necessary; it's sole caller already converted the
argument into a raw sha1
- the original used "rm -f", whereas the new one uses
"rm". The latter is better because it may notice a bug
or other unexpected failure in the test. (The original
does check that the object exists before we remove it,
which is good, but that's a subset of the possible
unexpected conditions).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-recursive.c')
0 files changed, 0 insertions, 0 deletions