1
0
mirror of https://github.com/git/git.git synced 2024-10-20 20:28:13 +02:00
git/builtin
Matheus Tavares 3f7ba60350 checkout-index: omit entries with no tempname from --temp output
With --temp (or --stage=all, which implies --temp), checkout-index
writes a list to stdout associating temporary file names to the entries'
names. But if it fails to write an entry, and the failure happens before
even assigning a temporary filename to that entry, we get an odd output
line. This can be seen when trying to check out a symlink whose blob is
missing:

$ missing_blob=$(git hash-object --stdin </dev/null)
$ git update-index --add --cacheinfo 120000,$missing_blob,foo
$ git checkout-index --temp foo
error: unable to read sha1 file of foo (e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)
        foo

The 'TAB foo' line is not much useful and it might break scripts that
expect the 'tempname TAB foo' output. So let's omit such entries from
the stdout list (but leaving the error message on stderr).

We could also consider omitting _all_ failed entries from the output
list, but that's probably not a good idea as the associated tempfiles
may have been created even when checkout failed, so scripts may want to
use the output list for cleanup.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-02-16 11:27:18 -08:00
..
add.c drop unused argc parameters 2020-09-30 12:53:47 -07:00
am.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
annotate.c
apply.c
archive.c
bisect--helper.c Merge branch 'mr/bisect-in-c-3' 2020-11-09 14:06:25 -08:00
blame.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
branch.c branch: sort detached HEAD based on a flag 2021-01-07 15:13:21 -08:00
bugreport.c builtin/bugreport.c: use thread-safe localtime_r() 2020-12-01 13:05:37 -08:00
bundle.c
cat-file.c
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout-index.c checkout-index: omit entries with no tempname from --temp output 2021-02-16 11:27:18 -08:00
checkout.c Merge branch 'dl/checkout-p-merge-base' 2020-12-23 13:59:46 -08:00
clean.c
clone.c Merge branch 'js/init-defaultbranch-advice' 2020-12-18 15:15:17 -08:00
column.c
commit-graph.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
commit-tree.c
commit.c Documentation: stylistically normalize references to Signed-off-by: 2020-10-20 11:57:40 -07:00
config.c config: implement --fixed-value with --get* 2020-11-25 14:43:48 -08:00
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c crendential-store: use timeout when locking file 2020-11-25 12:30:18 -08:00
credential.c credential: load default config 2020-10-16 12:30:45 -07:00
describe.c
diff-files.c
diff-index.c
diff-tree.c
diff.c Merge branch 'dl/diff-merge-base' 2020-11-02 13:17:39 -08:00
difftool.c Use new HASHMAP_INIT macro to simplify hashmap initialization 2020-11-11 12:55:27 -08:00
env--helper.c assert PARSE_OPT_NONEG in parse-options callbacks 2020-09-30 12:53:47 -07:00
fast-export.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
fast-import.c Merge branch 'jk/fast-import-marks-cleanup' 2020-11-02 13:17:40 -08:00
fetch-pack.c
fetch.c hashmap: provide deallocation function names 2020-11-02 12:15:50 -08:00
fmt-merge-msg.c
for-each-ref.c ref-filter: move ref_sorting flags to a bitfield 2021-01-07 15:13:21 -08:00
for-each-repo.c for-each-repo: do nothing on empty config 2021-01-07 19:12:02 -08:00
fsck.c
gc.c builtin/gc: don't peek into struct lock_file 2021-01-06 13:53:32 -08:00
get-tar-commit-id.c
grep.c grep: use designated initializers for grep_defaults 2020-11-21 14:50:33 -08:00
hash-object.c
help.c
index-pack.c compute pack .idx byte offsets using size_t 2020-11-16 13:41:35 -08:00
init-db.c get_default_branch_name(): prepare for showing some advice 2020-12-13 15:53:50 -08:00
interpret-trailers.c
log.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c merge-base, xdiff: zero out xpparam_t structures 2020-10-20 12:53:26 -07:00
merge.c Merge branch 'en/merge-ort-api-null-impl' 2020-11-18 13:32:53 -08:00
mktag.c
mktree.c
multi-pack-index.c
mv.c
name-rev.c
notes.c
pack-objects.c
pack-redundant.c Merge branch 'jx/pack-redundant-on-single-pack' 2020-12-23 13:59:46 -08:00
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c Merge branch 'pb/pull-rebase-recurse-submodules' 2020-12-03 00:18:06 -08:00
push.c Merge branch 'sk/force-if-includes' 2020-10-27 15:09:49 -07:00
range-diff.c
read-tree.c
rebase.c Merge branch 'rs/rebase-commit-validation' into maint 2021-02-05 16:31:22 -08:00
receive-pack.c Merge branch 'js/trace2-session-id' 2020-12-08 15:11:20 -08:00
reflog.c
remote-ext.c
remote-fd.c
remote.c config: convert multi_replace to flags 2020-11-25 14:43:47 -08:00
repack.c builtin/repack.c: don't move existing packs out of the way 2020-11-17 13:31:55 -08:00
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c rev-parse: handle --end-of-options 2020-11-10 13:46:27 -08:00
revert.c Merge branch 'en/merge-ort-api-null-impl' 2020-11-18 13:32:53 -08:00
rm.c
send-pack.c push: parse and set flag for "--force-if-includes" 2020-10-03 09:59:19 -07:00
shortlog.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
show-branch.c
show-index.c
show-ref.c
sparse-checkout.c sparse-checkout: fill in some options boilerplate 2020-09-30 12:53:48 -07:00
stash.c Merge branch 'en/stash-apply-sparse-checkout' into maint 2021-02-05 16:31:22 -08:00
stripspace.c
submodule--helper.c builtin/*: update usage format 2021-01-06 15:10:49 -08:00
symbolic-ref.c
tag.c ref-filter: move ref_sorting flags to a bitfield 2021-01-07 15:13:21 -08:00
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c update-ref: disallow "start" for ongoing transactions 2020-11-16 13:44:01 -08:00
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c Merge branch 'mt/worktree-error-message-fix' 2020-11-30 14:49:43 -08:00
write-tree.c