From cc36fd261e79a06f574c83aa657c97d3a154d37c Mon Sep 17 00:00:00 2001 From: kyle Date: Thu, 6 May 2021 19:26:52 +0000 Subject: [PATCH] reinject: silent failure with absolute path to pointer file --- ...ent_failure_with_absolute_path_to_poi.mdwn | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 doc/bugs/reinject__58___silent_failure_with_absolute_path_to_poi.mdwn diff --git a/doc/bugs/reinject__58___silent_failure_with_absolute_path_to_poi.mdwn b/doc/bugs/reinject__58___silent_failure_with_absolute_path_to_poi.mdwn new file mode 100644 index 0000000000..93c26832a5 --- /dev/null +++ b/doc/bugs/reinject__58___silent_failure_with_absolute_path_to_poi.mdwn @@ -0,0 +1,41 @@ +When using `reinject ` and `dest` is an absolute path to a +pointer file, the operation silently fails to reinject the content. + +[[!format sh """ +cd "$(mktemp -d "${TMPDIR:-/tmp}"/ga-XXXXXXX)" || exit 1 + +git version +git annex version | head -1 + +git init -q +git annex init +git config annex.addunlocked true + +git annex fromkey --force \ + SHA256E-s3--2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae \ + foo + +printf foo >.git/tmp-to-copy +git annex reinject .git/tmp-to-copy "$PWD"/foo +echo $? +cat foo +"""]] + +``` +git version 2.31.1.705.g1ce651569c +git-annex version: 8.20210429-g06e996efa +init (scanning for unlocked files...) +ok +(recording state in git...) +fromkey foo ok +(recording state in git...) +0 +/annex/objects/SHA256E-s3--2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae +``` + +If a link destination is used (i.e. drop the `addunlocked` +configuration in the script above) or a relative path is used +(i.e. drop the `"$PWD"/`), the content is injected. + +[[!meta author=kyle]] +[[!tag projects/datalad]] -- 2.30.2