Files
heartwood/radicle-cli/examples/rad-patch-fetch-1.md
T
Fintan Halpenny 6baefdb13f cli: use git for anonymous fetch
Shell out to `git`, avoiding using `git2`. This is to avoid an
issue where somewhere within the fetch there is an attempt to lookup a
`rad/sigrefs` object, which says that the object is missing. It is
suspected that this is due to the object being localised in the same
packfile as other objects we are fetching. Since the `rad/sigrefs`
object is never needed nor used in the working copy, this will always
result in the object missing. This seems to only be an issue with
`libgit2`/`git2` and not `git` itself.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2024-01-02 15:04:49 +01:00

1.1 KiB

This is a simple test to ensure the behavior of our remote helper is correct.

$ git rev-parse master
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
$ git checkout -b alice/1 -q
$ git commit --allow-empty -m "Change #1" -q
$ git rev-parse HEAD
7461703ce0fda972df450d071d1d3702057a6352
$ git push rad HEAD:alice/1
$ git status
On branch master
Your branch is up to date with 'rad/master'.

nothing to commit, working tree clean
$ git fetch --all
Fetching rad
Fetching alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
$ cat .git/FETCH_HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354		branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
7461703ce0fda972df450d071d1d3702057a6352	not-for-merge	branch 'alice/1' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354	not-for-merge	branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
$ git merge FETCH_HEAD
Already up to date.
$ git rev-parse master
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354
$ git rev-parse HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354