0s autopkgtest [14:42:20]: starting date and time: 2025-03-15 14:42:20+0000 0s autopkgtest [14:42:20]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [14:42:20]: host juju-7f2275-prod-proposed-migration-environment-2; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.fy3za67h/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:glibc --apt-upgrade r-cran-git2r --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=glibc/2.41-1ubuntu2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-2@bos03-arm64-11.secgroup --name adt-plucky-arm64-r-cran-git2r-20250315-144219-juju-7f2275-prod-proposed-migration-environment-2-ee914b27-c431-4db9-aaf0-20284814bd08 --image adt/ubuntu-plucky-arm64-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-2 --net-id=net_prod-proposed-migration -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 166s autopkgtest [14:45:06]: testbed dpkg architecture: arm64 166s autopkgtest [14:45:06]: testbed apt version: 2.9.33 167s autopkgtest [14:45:07]: @@@@@@@@@@@@@@@@@@@@ test bed setup 167s autopkgtest [14:45:07]: testbed release detected to be: None 168s autopkgtest [14:45:08]: updating testbed package index (apt update) 168s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [126 kB] 169s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 169s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 169s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 169s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [101 kB] 169s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.8 kB] 169s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [404 kB] 169s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 Packages [78.2 kB] 169s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 c-n-f Metadata [1976 B] 169s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted arm64 c-n-f Metadata [116 B] 169s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 Packages [346 kB] 170s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/universe arm64 c-n-f Metadata [15.8 kB] 170s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 Packages [4948 B] 170s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse arm64 c-n-f Metadata [572 B] 170s Fetched 1094 kB in 2s (685 kB/s) 171s Reading package lists... 172s Reading package lists... 172s Building dependency tree... 172s Reading state information... 173s Calculating upgrade... 173s Calculating upgrade... 174s The following packages will be upgraded: 174s python3-jinja2 strace 174s 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 174s Need to get 608 kB of archives. 174s After this operation, 11.3 kB of additional disk space will be used. 174s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 strace arm64 6.13+ds-1ubuntu1 [499 kB] 175s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 python3-jinja2 all 3.1.5-2ubuntu1 [109 kB] 176s Fetched 608 kB in 1s (608 kB/s) 176s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 176s Preparing to unpack .../strace_6.13+ds-1ubuntu1_arm64.deb ... 176s Unpacking strace (6.13+ds-1ubuntu1) over (6.11-0ubuntu1) ... 176s Preparing to unpack .../python3-jinja2_3.1.5-2ubuntu1_all.deb ... 176s Unpacking python3-jinja2 (3.1.5-2ubuntu1) over (3.1.5-2) ... 176s Setting up python3-jinja2 (3.1.5-2ubuntu1) ... 177s Setting up strace (6.13+ds-1ubuntu1) ... 177s Processing triggers for man-db (2.13.0-1) ... 178s Reading package lists... 178s Building dependency tree... 178s Reading state information... 178s Solving dependencies... 179s The following packages will be REMOVED: 179s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 179s libunwind8* linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 179s linux-image-6.11.0-8-generic* linux-modules-6.11.0-8-generic* 179s linux-tools-6.11.0-8* linux-tools-6.11.0-8-generic* 179s 0 upgraded, 0 newly installed, 11 to remove and 5 not upgraded. 179s After this operation, 267 MB disk space will be freed. 179s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 117701 files and directories currently installed.) 179s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 179s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 179s Removing libpython3.12t64:arm64 (3.12.9-1) ... 179s Removing libpython3.12-stdlib:arm64 (3.12.9-1) ... 180s Removing libnsl2:arm64 (1.3.0-3build3) ... 180s Removing libpython3.12-minimal:arm64 (3.12.9-1) ... 180s Removing libunwind8:arm64 (1.6.2-3.1) ... 180s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 180s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 182s Removing linux-image-6.11.0-8-generic (6.11.0-8.8) ... 182s I: /boot/vmlinuz.old is now a symlink to vmlinuz-6.14.0-10-generic 182s I: /boot/initrd.img.old is now a symlink to initrd.img-6.14.0-10-generic 182s /etc/kernel/postrm.d/initramfs-tools: 182s update-initramfs: Deleting /boot/initrd.img-6.11.0-8-generic 182s /etc/kernel/postrm.d/zz-flash-kernel: 182s flash-kernel: Kernel 6.11.0-8-generic has been removed. 182s flash-kernel: A higher version (6.14.0-10-generic) is still installed, no reflashing required. 183s /etc/kernel/postrm.d/zz-update-grub: 183s Sourcing file `/etc/default/grub' 183s Sourcing file `/etc/default/grub.d/50-cloudimg-settings.cfg' 183s Generating grub configuration file ... 183s Found linux image: /boot/vmlinuz-6.14.0-10-generic 183s Found initrd image: /boot/initrd.img-6.14.0-10-generic 183s Warning: os-prober will not be executed to detect other bootable partitions. 183s Systems on them will not be added to the GRUB boot configuration. 183s Check GRUB_DISABLE_OS_PROBER documentation entry. 183s Adding boot menu entry for UEFI Firmware Settings ... 184s done 184s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 184s Processing triggers for libc-bin (2.41-1ubuntu1) ... 184s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81650 files and directories currently installed.) 184s Purging configuration files for linux-image-6.11.0-8-generic (6.11.0-8.8) ... 184s Purging configuration files for libpython3.12-minimal:arm64 (3.12.9-1) ... 184s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 184s autopkgtest [14:45:24]: upgrading testbed (apt dist-upgrade and autopurge) 185s Reading package lists... 185s Building dependency tree... 185s Reading state information... 186s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 186s Starting 2 pkgProblemResolver with broken count: 0 186s Done 187s Entering ResolveByKeep 187s 188s Calculating upgrade... 189s The following packages will be upgraded: 189s libc-bin libc-dev-bin libc6 libc6-dev locales 189s 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 189s Need to get 9530 kB of archives. 189s After this operation, 0 B of additional disk space will be used. 189s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6-dev arm64 2.41-1ubuntu2 [1750 kB] 191s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-dev-bin arm64 2.41-1ubuntu2 [24.0 kB] 191s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc6 arm64 2.41-1ubuntu2 [2910 kB] 194s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 libc-bin arm64 2.41-1ubuntu2 [600 kB] 194s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main arm64 locales all 2.41-1ubuntu2 [4246 kB] 199s Preconfiguring packages ... 199s Fetched 9530 kB in 10s (966 kB/s) 199s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 199s Preparing to unpack .../libc6-dev_2.41-1ubuntu2_arm64.deb ... 199s Unpacking libc6-dev:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 200s Preparing to unpack .../libc-dev-bin_2.41-1ubuntu2_arm64.deb ... 200s Unpacking libc-dev-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 200s Preparing to unpack .../libc6_2.41-1ubuntu2_arm64.deb ... 200s Unpacking libc6:arm64 (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 200s Setting up libc6:arm64 (2.41-1ubuntu2) ... 200s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 200s Preparing to unpack .../libc-bin_2.41-1ubuntu2_arm64.deb ... 200s Unpacking libc-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 200s Setting up libc-bin (2.41-1ubuntu2) ... 200s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 201s Preparing to unpack .../locales_2.41-1ubuntu2_all.deb ... 201s Unpacking locales (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 201s Setting up locales (2.41-1ubuntu2) ... 202s Generating locales (this might take a while)... 204s en_US.UTF-8... done 204s Generation complete. 204s Setting up libc-dev-bin (2.41-1ubuntu2) ... 204s Setting up libc6-dev:arm64 (2.41-1ubuntu2) ... 204s Processing triggers for man-db (2.13.0-1) ... 205s Processing triggers for systemd (257.3-1ubuntu3) ... 206s Reading package lists... 206s Building dependency tree... 206s Reading state information... 206s Starting pkgProblemResolver with broken count: 0 207s Starting 2 pkgProblemResolver with broken count: 0 207s Done 207s Solving dependencies... 207s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 208s autopkgtest [14:45:48]: rebooting testbed after setup commands that affected boot 230s autopkgtest-virt-ssh: WARNING: ssh connection failed. Retrying in 3 seconds... 237s autopkgtest [14:46:17]: testbed running kernel: Linux 6.14.0-10-generic #10-Ubuntu SMP PREEMPT_DYNAMIC Wed Mar 12 15:45:31 UTC 2025 240s autopkgtest [14:46:20]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-git2r 242s Get:1 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (dsc) [2100 B] 242s Get:2 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (tar) [237 kB] 242s Get:3 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (diff) [3100 B] 243s gpgv: Signature made Sat Feb 22 06:18:41 2025 UTC 243s gpgv: using RSA key 5C7ABEA20F8630459CC8C8B5E27F2CF8458C2FA4 243s gpgv: Can't check signature: No public key 243s dpkg-source: warning: cannot verify inline signature for ./r-cran-git2r_0.35.0-1build1.dsc: no acceptable signature found 243s autopkgtest [14:46:23]: testing package r-cran-git2r version 0.35.0-1build1 243s autopkgtest [14:46:23]: build not needed 245s autopkgtest [14:46:25]: test run-unit-test: preparing testbed 246s Reading package lists... 246s Building dependency tree... 246s Reading state information... 247s Starting pkgProblemResolver with broken count: 0 247s Starting 2 pkgProblemResolver with broken count: 0 247s Done 248s The following NEW packages will be installed: 248s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono libblas3 248s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libgfortran5 libgit2-1.9 248s libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 libjpeg-turbo8 248s libjpeg8 liblapack3 liblerc4 libpango-1.0-0 libpangocairo-1.0-0 248s libpangoft2-1.0-0 libpaper-utils libpaper2 libpixman-1-0 libsharpyuv0 libsm6 248s libtcl8.6 libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 248s libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 r-base-core r-cran-git2r 248s unzip x11-common xdg-utils zip 248s 0 upgraded, 46 newly installed, 0 to remove and 0 not upgraded. 248s Need to get 39.4 MB of archives. 248s After this operation, 81.6 MB of additional disk space will be used. 248s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-mono all 2.37-8 [502 kB] 249s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 fonts-dejavu-core all 2.37-8 [835 kB] 250s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig-config arm64 2.15.0-2ubuntu1 [37.5 kB] 250s Get:4 http://ftpmaster.internal/ubuntu plucky/main arm64 libfontconfig1 arm64 2.15.0-2ubuntu1 [144 kB] 250s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 fontconfig arm64 2.15.0-2ubuntu1 [191 kB] 250s Get:6 http://ftpmaster.internal/ubuntu plucky/main arm64 libblas3 arm64 3.12.1-2 [161 kB] 251s Get:7 http://ftpmaster.internal/ubuntu plucky/main arm64 libpixman-1-0 arm64 0.44.0-3 [197 kB] 251s Get:8 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-render0 arm64 1.17.0-2 [16.6 kB] 251s Get:9 http://ftpmaster.internal/ubuntu plucky/main arm64 libxcb-shm0 arm64 1.17.0-2 [5884 B] 251s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 libxrender1 arm64 1:0.9.10-1.1build1 [18.8 kB] 251s Get:11 http://ftpmaster.internal/ubuntu plucky/main arm64 libcairo2 arm64 1.18.2-2 [560 kB] 251s Get:12 http://ftpmaster.internal/ubuntu plucky/main arm64 libdatrie1 arm64 0.2.13-3build1 [19.2 kB] 252s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 libdeflate0 arm64 1.23-1 [46.2 kB] 252s Get:14 http://ftpmaster.internal/ubuntu plucky/main arm64 libgfortran5 arm64 15-20250222-0ubuntu1 [444 kB] 252s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 libgit2-1.9 arm64 1.9.0+ds-1ubuntu1 [577 kB] 253s Get:16 http://ftpmaster.internal/ubuntu plucky/main arm64 libgomp1 arm64 15-20250222-0ubuntu1 [146 kB] 253s Get:17 http://ftpmaster.internal/ubuntu plucky/main arm64 libgraphite2-3 arm64 1.3.14-2ubuntu1 [70.6 kB] 253s Get:18 http://ftpmaster.internal/ubuntu plucky/main arm64 libharfbuzz0b arm64 10.2.0-1 [490 kB] 254s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 x11-common all 1:7.7+23ubuntu3 [21.7 kB] 254s Get:20 http://ftpmaster.internal/ubuntu plucky/main arm64 libice6 arm64 2:1.1.1-1 [42.3 kB] 254s Get:21 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-turbo8 arm64 2.1.5-3ubuntu2 [165 kB] 254s Get:22 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg8 arm64 8c-2ubuntu11 [2148 B] 254s Get:23 http://ftpmaster.internal/ubuntu plucky/main arm64 liblapack3 arm64 3.12.1-2 [2307 kB] 257s Get:24 http://ftpmaster.internal/ubuntu plucky/main arm64 liblerc4 arm64 4.0.0+ds-5ubuntu1 [167 kB] 258s Get:25 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai-data all 0.1.29-2build1 [158 kB] 258s Get:26 http://ftpmaster.internal/ubuntu plucky/main arm64 libthai0 arm64 0.1.29-2build1 [18.2 kB] 258s Get:27 http://ftpmaster.internal/ubuntu plucky/main arm64 libpango-1.0-0 arm64 1.56.2-1 [237 kB] 258s Get:28 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangoft2-1.0-0 arm64 1.56.2-1 [49.5 kB] 258s Get:29 http://ftpmaster.internal/ubuntu plucky/main arm64 libpangocairo-1.0-0 arm64 1.56.2-1 [27.6 kB] 258s Get:30 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper2 arm64 2.2.5-0.3 [17.3 kB] 258s Get:31 http://ftpmaster.internal/ubuntu plucky/main arm64 libpaper-utils arm64 2.2.5-0.3 [15.4 kB] 258s Get:32 http://ftpmaster.internal/ubuntu plucky/main arm64 libsharpyuv0 arm64 1.5.0-0.1 [16.9 kB] 258s Get:33 http://ftpmaster.internal/ubuntu plucky/main arm64 libsm6 arm64 2:1.2.4-1 [16.4 kB] 258s Get:34 http://ftpmaster.internal/ubuntu plucky/main arm64 libtcl8.6 arm64 8.6.16+dfsg-1 [987 kB] 259s Get:35 http://ftpmaster.internal/ubuntu plucky/main arm64 libjbig0 arm64 2.1-6.1ubuntu2 [29.3 kB] 260s Get:36 http://ftpmaster.internal/ubuntu plucky/main arm64 libwebp7 arm64 1.5.0-0.1 [194 kB] 260s Get:37 http://ftpmaster.internal/ubuntu plucky/main arm64 libtiff6 arm64 4.5.1+git230720-4ubuntu4 [193 kB] 260s Get:38 http://ftpmaster.internal/ubuntu plucky/main arm64 libxft2 arm64 2.3.6-1build1 [44.1 kB] 260s Get:39 http://ftpmaster.internal/ubuntu plucky/main arm64 libxss1 arm64 1:1.2.3-1build3 [7244 B] 260s Get:40 http://ftpmaster.internal/ubuntu plucky/main arm64 libtk8.6 arm64 8.6.16-1 [776 kB] 261s Get:41 http://ftpmaster.internal/ubuntu plucky/main arm64 libxt6t64 arm64 1:1.2.1-1.2build1 [168 kB] 261s Get:42 http://ftpmaster.internal/ubuntu plucky/main arm64 zip arm64 3.0-14ubuntu2 [173 kB] 262s Get:43 http://ftpmaster.internal/ubuntu plucky/main arm64 unzip arm64 6.0-28ubuntu6 [178 kB] 262s Get:44 http://ftpmaster.internal/ubuntu plucky/main arm64 xdg-utils all 1.2.1-2ubuntu1 [66.0 kB] 262s Get:45 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-base-core arm64 4.4.3-1 [28.4 MB] 302s Get:46 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-cran-git2r arm64 0.35.0-1build1 [442 kB] 303s Preconfiguring packages ... 303s Fetched 39.4 MB in 55s (719 kB/s) 303s Selecting previously unselected package fonts-dejavu-mono. 304s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 81647 files and directories currently installed.) 304s Preparing to unpack .../00-fonts-dejavu-mono_2.37-8_all.deb ... 304s Unpacking fonts-dejavu-mono (2.37-8) ... 304s Selecting previously unselected package fonts-dejavu-core. 304s Preparing to unpack .../01-fonts-dejavu-core_2.37-8_all.deb ... 304s Unpacking fonts-dejavu-core (2.37-8) ... 304s Selecting previously unselected package fontconfig-config. 304s Preparing to unpack .../02-fontconfig-config_2.15.0-2ubuntu1_arm64.deb ... 304s Unpacking fontconfig-config (2.15.0-2ubuntu1) ... 304s Selecting previously unselected package libfontconfig1:arm64. 304s Preparing to unpack .../03-libfontconfig1_2.15.0-2ubuntu1_arm64.deb ... 304s Unpacking libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 304s Selecting previously unselected package fontconfig. 304s Preparing to unpack .../04-fontconfig_2.15.0-2ubuntu1_arm64.deb ... 304s Unpacking fontconfig (2.15.0-2ubuntu1) ... 304s Selecting previously unselected package libblas3:arm64. 304s Preparing to unpack .../05-libblas3_3.12.1-2_arm64.deb ... 304s Unpacking libblas3:arm64 (3.12.1-2) ... 304s Selecting previously unselected package libpixman-1-0:arm64. 304s Preparing to unpack .../06-libpixman-1-0_0.44.0-3_arm64.deb ... 304s Unpacking libpixman-1-0:arm64 (0.44.0-3) ... 304s Selecting previously unselected package libxcb-render0:arm64. 304s Preparing to unpack .../07-libxcb-render0_1.17.0-2_arm64.deb ... 304s Unpacking libxcb-render0:arm64 (1.17.0-2) ... 304s Selecting previously unselected package libxcb-shm0:arm64. 305s Preparing to unpack .../08-libxcb-shm0_1.17.0-2_arm64.deb ... 305s Unpacking libxcb-shm0:arm64 (1.17.0-2) ... 305s Selecting previously unselected package libxrender1:arm64. 305s Preparing to unpack .../09-libxrender1_1%3a0.9.10-1.1build1_arm64.deb ... 305s Unpacking libxrender1:arm64 (1:0.9.10-1.1build1) ... 305s Selecting previously unselected package libcairo2:arm64. 305s Preparing to unpack .../10-libcairo2_1.18.2-2_arm64.deb ... 305s Unpacking libcairo2:arm64 (1.18.2-2) ... 305s Selecting previously unselected package libdatrie1:arm64. 305s Preparing to unpack .../11-libdatrie1_0.2.13-3build1_arm64.deb ... 305s Unpacking libdatrie1:arm64 (0.2.13-3build1) ... 305s Selecting previously unselected package libdeflate0:arm64. 305s Preparing to unpack .../12-libdeflate0_1.23-1_arm64.deb ... 305s Unpacking libdeflate0:arm64 (1.23-1) ... 305s Selecting previously unselected package libgfortran5:arm64. 305s Preparing to unpack .../13-libgfortran5_15-20250222-0ubuntu1_arm64.deb ... 305s Unpacking libgfortran5:arm64 (15-20250222-0ubuntu1) ... 305s Selecting previously unselected package libgit2-1.9:arm64. 305s Preparing to unpack .../14-libgit2-1.9_1.9.0+ds-1ubuntu1_arm64.deb ... 305s Unpacking libgit2-1.9:arm64 (1.9.0+ds-1ubuntu1) ... 305s Selecting previously unselected package libgomp1:arm64. 305s Preparing to unpack .../15-libgomp1_15-20250222-0ubuntu1_arm64.deb ... 305s Unpacking libgomp1:arm64 (15-20250222-0ubuntu1) ... 305s Selecting previously unselected package libgraphite2-3:arm64. 305s Preparing to unpack .../16-libgraphite2-3_1.3.14-2ubuntu1_arm64.deb ... 305s Unpacking libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 305s Selecting previously unselected package libharfbuzz0b:arm64. 305s Preparing to unpack .../17-libharfbuzz0b_10.2.0-1_arm64.deb ... 305s Unpacking libharfbuzz0b:arm64 (10.2.0-1) ... 305s Selecting previously unselected package x11-common. 305s Preparing to unpack .../18-x11-common_1%3a7.7+23ubuntu3_all.deb ... 305s Unpacking x11-common (1:7.7+23ubuntu3) ... 305s Selecting previously unselected package libice6:arm64. 305s Preparing to unpack .../19-libice6_2%3a1.1.1-1_arm64.deb ... 305s Unpacking libice6:arm64 (2:1.1.1-1) ... 305s Selecting previously unselected package libjpeg-turbo8:arm64. 305s Preparing to unpack .../20-libjpeg-turbo8_2.1.5-3ubuntu2_arm64.deb ... 305s Unpacking libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 305s Selecting previously unselected package libjpeg8:arm64. 305s Preparing to unpack .../21-libjpeg8_8c-2ubuntu11_arm64.deb ... 305s Unpacking libjpeg8:arm64 (8c-2ubuntu11) ... 305s Selecting previously unselected package liblapack3:arm64. 305s Preparing to unpack .../22-liblapack3_3.12.1-2_arm64.deb ... 305s Unpacking liblapack3:arm64 (3.12.1-2) ... 305s Selecting previously unselected package liblerc4:arm64. 305s Preparing to unpack .../23-liblerc4_4.0.0+ds-5ubuntu1_arm64.deb ... 305s Unpacking liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 305s Selecting previously unselected package libthai-data. 305s Preparing to unpack .../24-libthai-data_0.1.29-2build1_all.deb ... 305s Unpacking libthai-data (0.1.29-2build1) ... 305s Selecting previously unselected package libthai0:arm64. 305s Preparing to unpack .../25-libthai0_0.1.29-2build1_arm64.deb ... 305s Unpacking libthai0:arm64 (0.1.29-2build1) ... 305s Selecting previously unselected package libpango-1.0-0:arm64. 305s Preparing to unpack .../26-libpango-1.0-0_1.56.2-1_arm64.deb ... 305s Unpacking libpango-1.0-0:arm64 (1.56.2-1) ... 305s Selecting previously unselected package libpangoft2-1.0-0:arm64. 305s Preparing to unpack .../27-libpangoft2-1.0-0_1.56.2-1_arm64.deb ... 305s Unpacking libpangoft2-1.0-0:arm64 (1.56.2-1) ... 306s Selecting previously unselected package libpangocairo-1.0-0:arm64. 306s Preparing to unpack .../28-libpangocairo-1.0-0_1.56.2-1_arm64.deb ... 306s Unpacking libpangocairo-1.0-0:arm64 (1.56.2-1) ... 306s Selecting previously unselected package libpaper2:arm64. 306s Preparing to unpack .../29-libpaper2_2.2.5-0.3_arm64.deb ... 306s Unpacking libpaper2:arm64 (2.2.5-0.3) ... 306s Selecting previously unselected package libpaper-utils. 306s Preparing to unpack .../30-libpaper-utils_2.2.5-0.3_arm64.deb ... 306s Unpacking libpaper-utils (2.2.5-0.3) ... 306s Selecting previously unselected package libsharpyuv0:arm64. 306s Preparing to unpack .../31-libsharpyuv0_1.5.0-0.1_arm64.deb ... 306s Unpacking libsharpyuv0:arm64 (1.5.0-0.1) ... 306s Selecting previously unselected package libsm6:arm64. 306s Preparing to unpack .../32-libsm6_2%3a1.2.4-1_arm64.deb ... 306s Unpacking libsm6:arm64 (2:1.2.4-1) ... 306s Selecting previously unselected package libtcl8.6:arm64. 306s Preparing to unpack .../33-libtcl8.6_8.6.16+dfsg-1_arm64.deb ... 306s Unpacking libtcl8.6:arm64 (8.6.16+dfsg-1) ... 306s Selecting previously unselected package libjbig0:arm64. 306s Preparing to unpack .../34-libjbig0_2.1-6.1ubuntu2_arm64.deb ... 306s Unpacking libjbig0:arm64 (2.1-6.1ubuntu2) ... 306s Selecting previously unselected package libwebp7:arm64. 306s Preparing to unpack .../35-libwebp7_1.5.0-0.1_arm64.deb ... 306s Unpacking libwebp7:arm64 (1.5.0-0.1) ... 306s Selecting previously unselected package libtiff6:arm64. 306s Preparing to unpack .../36-libtiff6_4.5.1+git230720-4ubuntu4_arm64.deb ... 306s Unpacking libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 306s Selecting previously unselected package libxft2:arm64. 306s Preparing to unpack .../37-libxft2_2.3.6-1build1_arm64.deb ... 306s Unpacking libxft2:arm64 (2.3.6-1build1) ... 306s Selecting previously unselected package libxss1:arm64. 306s Preparing to unpack .../38-libxss1_1%3a1.2.3-1build3_arm64.deb ... 306s Unpacking libxss1:arm64 (1:1.2.3-1build3) ... 306s Selecting previously unselected package libtk8.6:arm64. 306s Preparing to unpack .../39-libtk8.6_8.6.16-1_arm64.deb ... 306s Unpacking libtk8.6:arm64 (8.6.16-1) ... 306s Selecting previously unselected package libxt6t64:arm64. 306s Preparing to unpack .../40-libxt6t64_1%3a1.2.1-1.2build1_arm64.deb ... 306s Unpacking libxt6t64:arm64 (1:1.2.1-1.2build1) ... 306s Selecting previously unselected package zip. 306s Preparing to unpack .../41-zip_3.0-14ubuntu2_arm64.deb ... 306s Unpacking zip (3.0-14ubuntu2) ... 306s Selecting previously unselected package unzip. 306s Preparing to unpack .../42-unzip_6.0-28ubuntu6_arm64.deb ... 306s Unpacking unzip (6.0-28ubuntu6) ... 306s Selecting previously unselected package xdg-utils. 306s Preparing to unpack .../43-xdg-utils_1.2.1-2ubuntu1_all.deb ... 306s Unpacking xdg-utils (1.2.1-2ubuntu1) ... 306s Selecting previously unselected package r-base-core. 306s Preparing to unpack .../44-r-base-core_4.4.3-1_arm64.deb ... 306s Unpacking r-base-core (4.4.3-1) ... 307s Selecting previously unselected package r-cran-git2r. 307s Preparing to unpack .../45-r-cran-git2r_0.35.0-1build1_arm64.deb ... 307s Unpacking r-cran-git2r (0.35.0-1build1) ... 307s Setting up libgraphite2-3:arm64 (1.3.14-2ubuntu1) ... 307s Setting up libpixman-1-0:arm64 (0.44.0-3) ... 307s Setting up libsharpyuv0:arm64 (1.5.0-0.1) ... 307s Setting up liblerc4:arm64 (4.0.0+ds-5ubuntu1) ... 307s Setting up libxrender1:arm64 (1:0.9.10-1.1build1) ... 307s Setting up libdatrie1:arm64 (0.2.13-3build1) ... 307s Setting up libxcb-render0:arm64 (1.17.0-2) ... 307s Setting up unzip (6.0-28ubuntu6) ... 307s Setting up x11-common (1:7.7+23ubuntu3) ... 307s Setting up libdeflate0:arm64 (1.23-1) ... 307s Setting up libxcb-shm0:arm64 (1.17.0-2) ... 307s Setting up libgomp1:arm64 (15-20250222-0ubuntu1) ... 307s Setting up libjbig0:arm64 (2.1-6.1ubuntu2) ... 307s Setting up zip (3.0-14ubuntu2) ... 307s Setting up libblas3:arm64 (3.12.1-2) ... 307s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so.3 to provide /usr/lib/aarch64-linux-gnu/libblas.so.3 (libblas.so.3-aarch64-linux-gnu) in auto mode 307s Setting up fonts-dejavu-mono (2.37-8) ... 307s Setting up libtcl8.6:arm64 (8.6.16+dfsg-1) ... 307s Setting up fonts-dejavu-core (2.37-8) ... 307s Setting up libjpeg-turbo8:arm64 (2.1.5-3ubuntu2) ... 307s Setting up libgit2-1.9:arm64 (1.9.0+ds-1ubuntu1) ... 307s Setting up libgfortran5:arm64 (15-20250222-0ubuntu1) ... 307s Setting up libwebp7:arm64 (1.5.0-0.1) ... 307s Setting up libharfbuzz0b:arm64 (10.2.0-1) ... 307s Setting up libthai-data (0.1.29-2build1) ... 307s Setting up libxss1:arm64 (1:1.2.3-1build3) ... 307s Setting up libpaper2:arm64 (2.2.5-0.3) ... 307s Setting up xdg-utils (1.2.1-2ubuntu1) ... 307s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 307s Setting up libjpeg8:arm64 (8c-2ubuntu11) ... 307s Setting up libice6:arm64 (2:1.1.1-1) ... 307s Setting up liblapack3:arm64 (3.12.1-2) ... 307s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/aarch64-linux-gnu/liblapack.so.3 (liblapack.so.3-aarch64-linux-gnu) in auto mode 307s Setting up fontconfig-config (2.15.0-2ubuntu1) ... 308s Setting up libpaper-utils (2.2.5-0.3) ... 308s Setting up libthai0:arm64 (0.1.29-2build1) ... 308s Setting up libtiff6:arm64 (4.5.1+git230720-4ubuntu4) ... 308s Setting up libfontconfig1:arm64 (2.15.0-2ubuntu1) ... 308s Setting up libsm6:arm64 (2:1.2.4-1) ... 308s Setting up fontconfig (2.15.0-2ubuntu1) ... 310s Regenerating fonts cache... done. 310s Setting up libxft2:arm64 (2.3.6-1build1) ... 310s Setting up libtk8.6:arm64 (8.6.16-1) ... 310s Setting up libpango-1.0-0:arm64 (1.56.2-1) ... 310s Setting up libcairo2:arm64 (1.18.2-2) ... 310s Setting up libxt6t64:arm64 (1:1.2.1-1.2build1) ... 310s Setting up libpangoft2-1.0-0:arm64 (1.56.2-1) ... 310s Setting up libpangocairo-1.0-0:arm64 (1.56.2-1) ... 310s Setting up r-base-core (4.4.3-1) ... 310s Creating config file /etc/R/Renviron with new version 310s Setting up r-cran-git2r (0.35.0-1build1) ... 310s Processing triggers for man-db (2.13.0-1) ... 311s Processing triggers for install-info (7.1.1-1) ... 311s Processing triggers for libc-bin (2.41-1ubuntu2) ... 313s autopkgtest [14:47:33]: test run-unit-test: [----------------------- 313s BEGIN TEST add-force.R 313s 313s R version 4.4.3 (2025-02-28) -- "Trophy Case" 313s Copyright (C) 2025 The R Foundation for Statistical Computing 313s Platform: aarch64-unknown-linux-gnu 313s 313s R is free software and comes with ABSOLUTELY NO WARRANTY. 313s You are welcome to redistribute it under certain conditions. 313s Type 'license()' or 'licence()' for distribution details. 313s 313s R is a collaborative project with many contributors. 313s Type 'contributors()' for more information and 313s 'citation()' on how to cite R or R packages in publications. 313s 313s Type 'demo()' for some demos, 'help()' for on-line help, or 313s 'help.start()' for an HTML browser interface to help. 313s Type 'q()' to quit R. 313s 313s > ## git2r, R bindings to the libgit2 library. 313s > ## Copyright (C) 2013-2023 The git2r contributors 313s > ## 313s > ## This program is free software; you can redistribute it and/or modify 313s > ## it under the terms of the GNU General Public License, version 2, 313s > ## as published by the Free Software Foundation. 313s > ## 313s > ## git2r is distributed in the hope that it will be useful, 313s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 313s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 313s > ## GNU General Public License for more details. 313s > ## 313s > ## You should have received a copy of the GNU General Public License along 313s > ## with this program; if not, write to the Free Software Foundation, Inc., 313s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 313s > 313s > library(git2r) 313s > source("util/check.R") 313s > 313s > ## For debugging 313s > sessionInfo() 313s R version 4.4.3 (2025-02-28) 313s Platform: aarch64-unknown-linux-gnu 313s Running under: Ubuntu Plucky Puffin (development branch) 313s 313s Matrix products: default 313s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 313s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 313s 313s locale: 313s [1] C 313s 313s time zone: Etc/UTC 313s tzcode source: system (glibc) 313s 313s attached base packages: 313s [1] stats graphics grDevices utils datasets methods base 313s 313s other attached packages: 313s [1] git2r_0.35.0 313s 313s loaded via a namespace (and not attached): 313s [1] compiler_4.4.3 313s > libgit2_version() 313s $major 313s [1] 1 313s 313s $minor 313s [1] 9 313s 313s $rev 313s [1] 0 313s 313s > libgit2_features() 313s $threads 313s [1] TRUE 313s 313s $https 313s [1] TRUE 313s 313s $ssh 313s [1] TRUE 313s 313s > 313s > ## Create a directory in tempdir 313s > path <- tempfile(pattern = "git2r-") 313s > dir.create(path) 313s > 313s > ## Initialize a repository 313s > repo <- init(path) 313s > config(repo, user.name = "Alice", user.email = "alice@example.org") 313s > 313s > ## Create a '.gitignore' file 313s > writeLines("test.txt", file.path(path, ".gitignore")) 313s > add(repo, ".gitignore") 313s > commit(repo, "First commit message") 313s [750519d] 2025-03-15: First commit message 313s > 313s > ## Create a file 313s > writeLines("Hello world!", file.path(path, "test.txt")) 313s > 313s > ## Check status 313s > s_1 <- structure(list(staged = empty_named_list(), 313s + unstaged = empty_named_list(), 313s + untracked = empty_named_list(), 313s + ignored = list(ignored = "test.txt")), 313s + class = "git_status") 313s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 313s > 313s > ## The file is ignored and should not be added 313s > add(repo, "test.txt") 313s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 313s > 313s > ## The file is ignored but should be added with force 313s > s_2 <- structure(list(staged = list(new = "test.txt"), 313s + unstaged = empty_named_list(), 313s + untracked = empty_named_list(), 313s + ignored = empty_named_list()), 313s + class = "git_status") 313s > 313s > add(repo, "test.txt", force = TRUE) 313s > stopifnot(identical(status(repo, ignored = TRUE), s_2)) 313s > 313s > ## Commit and check status 313s > s_3 <- structure(list(staged = empty_named_list(), 313s + unstaged = empty_named_list(), 313s + untracked = empty_named_list(), 313s + ignored = empty_named_list()), 313s + class = "git_status") 313s > 313s > commit(repo, "Second commit message") 313s [1ff6555] 2025-03-15: Second commit message 313s > stopifnot(identical(status(repo, ignored = TRUE), s_3)) 313s > 313s > ## Cleanup 313s > unlink(path, recursive = TRUE) 313s > 313s BEGIN TEST bare_repository.R 314s 314s R version 4.4.3 (2025-02-28) -- "Trophy Case" 314s Copyright (C) 2025 The R Foundation for Statistical Computing 314s Platform: aarch64-unknown-linux-gnu 314s 314s R is free software and comes with ABSOLUTELY NO WARRANTY. 314s You are welcome to redistribute it under certain conditions. 314s Type 'license()' or 'licence()' for distribution details. 314s 314s R is a collaborative project with many contributors. 314s Type 'contributors()' for more information and 314s 'citation()' on how to cite R or R packages in publications. 314s 314s Type 'demo()' for some demos, 'help()' for on-line help, or 314s 'help.start()' for an HTML browser interface to help. 314s Type 'q()' to quit R. 314s 314s > ## git2r, R bindings to the libgit2 library. 314s > ## Copyright (C) 2013-2023 The git2r contributors 314s > ## 314s > ## This program is free software; you can redistribute it and/or modify 314s > ## it under the terms of the GNU General Public License, version 2, 314s > ## as published by the Free Software Foundation. 314s > ## 314s > ## git2r is distributed in the hope that it will be useful, 314s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 314s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 314s > ## GNU General Public License for more details. 314s > ## 314s > ## You should have received a copy of the GNU General Public License along 314s > ## with this program; if not, write to the Free Software Foundation, Inc., 314s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 314s > 314s > library("git2r") 314s > 314s > ## For debugging 314s > sessionInfo() 314s R version 4.4.3 (2025-02-28) 314s Platform: aarch64-unknown-linux-gnu 314s Running under: Ubuntu Plucky Puffin (development branch) 314s 314s Matrix products: default 314s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 314s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 314s 314s locale: 314s [1] C 314s 314s time zone: Etc/UTC 314s tzcode source: system (glibc) 314s 314s attached base packages: 314s [1] stats graphics grDevices utils datasets methods base 314s 314s other attached packages: 314s [1] git2r_0.35.0 314s 314s loaded via a namespace (and not attached): 314s [1] compiler_4.4.3 314s > libgit2_version() 314s $major 314s [1] 1 314s 314s $minor 314s [1] 9 314s 314s $rev 314s [1] 0 314s 314s > libgit2_features() 314s $threads 314s [1] TRUE 314s 314s $https 314s [1] TRUE 314s 314s $ssh 314s [1] TRUE 314s 314s > 314s > 314s > ## Create a directory in tempdir 314s > path <- tempfile(pattern = "git2r-") 314s > dir.create(path) 314s > 314s > ## Initialize a bare repository 314s > repo <- init(path, bare = TRUE) 314s > 314s > ## Check that the state of the repository 314s > stopifnot(identical(is_bare(repo), TRUE)) 314s > stopifnot(identical(is_empty(repo), TRUE)) 314s > 314s > ## Check that workdir is NULL for a bare repository 314s > stopifnot(is.null(workdir(repo))) 314s > 314s > ## Check with missing repo argument 314s > setwd(path) 314s > stopifnot(identical(is_bare(), TRUE)) 314s > 314s > ## Cleanup 314s > unlink(path, recursive = TRUE) 314s > 314s sh: 0: getcwd() failed: No such file or directory 314s BEGIN TEST blame.R 314s 314s R version 4.4.3 (2025-02-28) -- "Trophy Case" 314s Copyright (C) 2025 The R Foundation for Statistical Computing 314s Platform: aarch64-unknown-linux-gnu 314s 314s R is free software and comes with ABSOLUTELY NO WARRANTY. 314s You are welcome to redistribute it under certain conditions. 314s Type 'license()' or 'licence()' for distribution details. 314s 314s R is a collaborative project with many contributors. 314s Type 'contributors()' for more information and 314s 'citation()' on how to cite R or R packages in publications. 314s 314s Type 'demo()' for some demos, 'help()' for on-line help, or 314s 'help.start()' for an HTML browser interface to help. 314s Type 'q()' to quit R. 314s 314s > ## git2r, R bindings to the libgit2 library. 314s > ## Copyright (C) 2013-2023 The git2r contributors 314s > ## 314s > ## This program is free software; you can redistribute it and/or modify 314s > ## it under the terms of the GNU General Public License, version 2, 314s > ## as published by the Free Software Foundation. 314s > ## 314s > ## git2r is distributed in the hope that it will be useful, 314s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 314s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 314s > ## GNU General Public License for more details. 314s > ## 314s > ## You should have received a copy of the GNU General Public License along 314s > ## with this program; if not, write to the Free Software Foundation, Inc., 314s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 314s > 314s > library(git2r) 314s > 314s > ## For debugging 314s > sessionInfo() 314s R version 4.4.3 (2025-02-28) 314s Platform: aarch64-unknown-linux-gnu 314s Running under: Ubuntu Plucky Puffin (development branch) 314s 314s Matrix products: default 314s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 314s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 314s 314s locale: 314s [1] C 314s 314s time zone: Etc/UTC 314s tzcode source: system (glibc) 314s 314s attached base packages: 314s [1] stats graphics grDevices utils datasets methods base 314s 314s other attached packages: 314s [1] git2r_0.35.0 314s 314s loaded via a namespace (and not attached): 314s [1] compiler_4.4.3 314s > libgit2_version() 314s $major 314s [1] 1 314s 314s $minor 314s [1] 9 314s 314s $rev 314s [1] 0 314s 314s > libgit2_features() 314s $threads 314s [1] TRUE 314s 314s $https 314s [1] TRUE 314s 314s $ssh 314s [1] TRUE 314s 314s > 314s > 314s > ## Create a directory in tempdir 314s > path <- tempfile(pattern = "git2r-") 314s > dir.create(path) 314s > 314s > ## Initialize a repository 314s > repo <- init(path) 314s > config(repo, user.name = "Alice", user.email = "alice@example.org") 314s > 314s > ## Create a file and commit 314s > writeLines("Hello world!", file.path(path, "test.txt")) 314s > add(repo, "test.txt") 314s > commit_1 <- commit(repo, "First commit message") 314s > 314s > ## Create new user and change file 314s > config(repo, user.name = "Bob", user.email = "bob@example.org") 314s > writeLines(c("Hello world!", "HELLO WORLD!", "HOLA"), 314s + file.path(path, "test.txt")) 314s > add(repo, "test.txt") 314s > commit_2 <- commit(repo, "Second commit message") 314s > 314s > ## Check blame 314s > b <- blame(repo, "test.txt") 314s > stopifnot(identical(length(b$hunks), 2L)) 314s > 314s > ## Hunk: 1 314s > stopifnot(identical(b$hunks[[1]]$lines_in_hunk, 1L)) 314s > stopifnot(identical(b$hunks[[1]]$final_commit_id, sha(commit_1))) 314s > stopifnot(identical(b$hunks[[1]]$final_start_line_number, 1L)) 314s > stopifnot(identical(b$hunks[[1]]$final_signature$name, "Alice")) 314s > stopifnot(identical(b$hunks[[1]]$final_signature$email, "alice@example.org")) 314s > stopifnot(identical(b$hunks[[1]]$orig_commit_id, sha(commit_1))) 314s > stopifnot(identical(b$hunks[[1]]$orig_start_line_number, 1L)) 314s > stopifnot(identical(b$hunks[[1]]$orig_signature$name, "Alice")) 314s > stopifnot(identical(b$hunks[[1]]$orig_signature$email, "alice@example.org")) 314s > stopifnot(identical(b$hunks[[1]]$orig_path, "test.txt")) 314s > stopifnot(identical(b$hunks[[1]]$boundary, TRUE)) 314s > 314s > ## Hunk: 2 314s > stopifnot(identical(b$hunks[[2]]$lines_in_hunk, 2L)) 314s > stopifnot(identical(b$hunks[[2]]$final_commit_id, sha(commit_2))) 314s > stopifnot(identical(b$hunks[[2]]$final_start_line_number, 2L)) 314s > stopifnot(identical(b$hunks[[2]]$final_signature$name, "Bob")) 314s > stopifnot(identical(b$hunks[[2]]$final_signature$email, "bob@example.org")) 314s > stopifnot(identical(b$hunks[[2]]$orig_commit_id, sha(commit_2))) 314s > stopifnot(identical(b$hunks[[2]]$orig_start_line_number, 2L)) 314s > stopifnot(identical(b$hunks[[2]]$orig_signature$name, "Bob")) 314s > stopifnot(identical(b$hunks[[2]]$orig_signature$email, "bob@example.org")) 314s > stopifnot(identical(b$hunks[[2]]$orig_path, "test.txt")) 314s > stopifnot(identical(b$hunks[[2]]$boundary, FALSE)) 314s > 314s > ## Cleanup 314s > unlink(path, recursive = TRUE) 314s > 314s BEGIN TEST blob.R 314s 314s R version 4.4.3 (2025-02-28) -- "Trophy Case" 314s Copyright (C) 2025 The R Foundation for Statistical Computing 314s Platform: aarch64-unknown-linux-gnu 314s 314s R is free software and comes with ABSOLUTELY NO WARRANTY. 314s You are welcome to redistribute it under certain conditions. 314s Type 'license()' or 'licence()' for distribution details. 314s 314s R is a collaborative project with many contributors. 314s Type 'contributors()' for more information and 314s 'citation()' on how to cite R or R packages in publications. 314s 314s Type 'demo()' for some demos, 'help()' for on-line help, or 314s 'help.start()' for an HTML browser interface to help. 314s Type 'q()' to quit R. 314s 314s > ## git2r, R bindings to the libgit2 library. 314s > ## Copyright (C) 2013-2023 The git2r contributors 314s > ## 314s > ## This program is free software; you can redistribute it and/or modify 314s > ## it under the terms of the GNU General Public License, version 2, 314s > ## as published by the Free Software Foundation. 314s > ## 314s > ## git2r is distributed in the hope that it will be useful, 314s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 314s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 314s > ## GNU General Public License for more details. 314s > ## 314s > ## You should have received a copy of the GNU General Public License along 314s > ## with this program; if not, write to the Free Software Foundation, Inc., 314s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 314s > 314s > library(git2r) 314s > library(tools) 314s > source("util/check.R") 314s > 314s > ## For debugging 314s > sessionInfo() 314s R version 4.4.3 (2025-02-28) 314s Platform: aarch64-unknown-linux-gnu 314s Running under: Ubuntu Plucky Puffin (development branch) 314s 314s Matrix products: default 314s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 314s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 314s 314s locale: 314s [1] C 314s 314s time zone: Etc/UTC 314s tzcode source: system (glibc) 314s 314s attached base packages: 314s [1] tools stats graphics grDevices utils datasets methods 314s [8] base 314s 314s other attached packages: 314s [1] git2r_0.35.0 314s 314s loaded via a namespace (and not attached): 314s [1] compiler_4.4.3 314s > libgit2_version() 314s $major 314s [1] 1 314s 314s $minor 314s [1] 9 314s 314s $rev 314s [1] 0 314s 314s > libgit2_features() 314s $threads 314s [1] TRUE 314s 314s $https 314s [1] TRUE 314s 314s $ssh 314s [1] TRUE 314s 314s > 314s > 314s > ## Create a directory in tempdir 314s > path <- tempfile(pattern = "git2r-") 314s > dir.create(path) 314s > 314s > ## Initialize a repository 314s > repo <- init(path) 314s > config(repo, user.name = "Alice", user.email = "alice@example.org") 314s > 314s > ## Create a file 314s > f <- file(file.path(path, "test.txt"), "wb") 314s > writeChar("Hello world!\n", f, eos = NULL) 314s > close(f) 314s > 314s > ## add and commit 314s > add(repo, "test.txt") 314s > new_commit <- commit(repo, "Commit message") 314s > 314s > ## Lookup blob 314s > blob <- lookup(repo, "cd0875583aabe89ee197ea133980a9085d08e497") 314s > stopifnot(isTRUE(is_blob(blob))) 314s > stopifnot(identical(sha(blob), "cd0875583aabe89ee197ea133980a9085d08e497")) 314s > stopifnot(identical(is_binary(blob), FALSE)) 314s > stopifnot(identical(blob, lookup(repo, "cd0875"))) 314s > stopifnot(identical(length(blob), 13L)) 314s > stopifnot(identical(content(blob), "Hello world!")) 314s > stopifnot(identical(print(blob), blob)) 314s blob: cd0875583aabe89ee197ea133980a9085d08e497 314s size: 13 bytes 314s > 314s > ## Add one more commit 314s > f <- file(file.path(path, "test.txt"), "wb") 314s > writeChar("Hello world!\nHELLO WORLD!\nHeLlO wOrLd!\n", f, eos = NULL) 314s > close(f) 314s > add(repo, "test.txt") 314s > blob <- lookup(repo, tree(commit(repo, "New commit message"))$id[1]) 314s > stopifnot(identical(content(blob), 314s + c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"))) 314s > stopifnot(identical(rawToChar(content(blob, raw = TRUE)), 314s + content(blob, split = FALSE))) 314s > 314s > ## Check content of binary file 314s > set.seed(42) 314s > x <- as.raw((sample(0:255, 1000, replace = TRUE))) 314s > writeBin(x, con = file.path(path, "test.bin")) 314s > add(repo, "test.bin") 314s > commit(repo, "Add binary file") 314s [ff7854c] 2025-03-15: Add binary file 314s > blob <- tree(last_commit(repo))["test.bin"] 314s > stopifnot(identical(content(blob), NA_character_)) 314s > stopifnot(identical(x, content(blob, raw = TRUE))) 314s > 314s > ## Hash 314s > stopifnot(identical(hash("Hello, world!\n"), 314s + "af5626b4a114abcb82d63db7c8082c3c4756e51b")) 314s > stopifnot(identical(hash("test content\n"), 314s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4")) 314s > stopifnot(identical(hash(c("Hello, world!\n", 314s + "test content\n")), 314s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 314s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 314s > stopifnot(identical(hash(c("Hello, world!\n", 314s + NA_character_, 314s + "test content\n")), 314s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 314s + NA_character_, 314s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 314s > stopifnot(identical(hash(character(0)), character(0))) 314s > 314s > ## Hash file 314s > test_1_txt <- file(file.path(path, "test-1.txt"), "wb") 314s > writeChar("Hello, world!\n", test_1_txt, eos = NULL) 314s > close(test_1_txt) 314s > test_2_txt <- file(file.path(path, "test-2.txt"), "wb") 314s > writeChar("test content\n", test_2_txt, eos = NULL) 314s > close(test_2_txt) 314s > stopifnot(identical(hash("Hello, world!\n"), 314s + hashfile(file.path(path, "test-1.txt")))) 314s > stopifnot(identical(hash("test content\n"), 314s + hashfile(file.path(path, "test-2.txt")))) 314s > stopifnot(identical(hash(c("Hello, world!\n", 314s + "test content\n")), 314s + hashfile(c(file.path(path, "test-1.txt"), 314s + file.path(path, "test-2.txt"))))) 314s > assertError(hashfile(c(file.path(path, "test-1.txt"), 314s + NA_character_, 314s + file.path(path, "test-2.txt")))) 314s > stopifnot(identical(hashfile(character(0)), character(0))) 314s > 314s > ## Create blob from disk 314s > tmp_file_1 <- tempfile() 314s > tmp_file_2 <- tempfile() 314s > f1 <- file(tmp_file_1, "wb") 314s > writeChar("Hello, world!\n", f1, eos = NULL) 314s > close(f1) 314s > f2 <- file(tmp_file_2, "wb") 314s > writeChar("test content\n", f2, eos = NULL) 314s > close(f2) 314s > blob_list_1 <- blob_create(repo, c(tmp_file_1, tmp_file_2), relative = FALSE) 314s > unlink(tmp_file_1) 314s > unlink(tmp_file_2) 314s > stopifnot(identical(sapply(blob_list_1, "[[", "sha"), 314s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 314s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 314s > 314s > ## Create blob from workdir 314s > tmp_file_3 <- file.path(path, "test-workdir-1.txt") 314s > tmp_file_4 <- file.path(path, "test-workdir-2.txt") 314s > f3 <- file(tmp_file_3, "wb") 314s > writeChar("Hello, world!\n", f3, eos = NULL) 314s > close(f3) 314s > f4 <- file(tmp_file_4, "wb") 314s > writeChar("test content\n", f4, eos = NULL) 314s > close(f4) 314s > blob_list_2 <- blob_create(repo, c("test-workdir-1.txt", 314s + "test-workdir-2.txt")) 314s > stopifnot(identical(sapply(blob_list_2, "[[", "sha"), 314s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 314s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 314s > 314s > ## Test arguments 314s > check_error(assertError(.Call(git2r:::git2r_blob_content, NULL, FALSE)), 314s + "'blob' must be an S3 class git_blob") 314s > check_error(assertError(.Call(git2r:::git2r_blob_content, 3, FALSE)), 314s + "'blob' must be an S3 class git_blob") 314s > check_error(assertError(.Call(git2r:::git2r_blob_content, repo, FALSE)), 314s + "'blob' must be an S3 class git_blob") 314s > 314s > b <- blob_list_1[[1]] 314s > b$sha <- NA_character_ 314s > check_error(assertError(.Call(git2r:::git2r_blob_content, b, FALSE)), 314s + "'blob' must be an S3 class git_blob") 314s > 314s > check_error(assertError(hashfile(NA)), "invalid 'path' argument") 314s > 314s > ## Cleanup 314s > unlink(path, recursive = TRUE) 314s > 314s BEGIN TEST branch.R 314s 314s R version 4.4.3 (2025-02-28) -- "Trophy Case" 314s Copyright (C) 2025 The R Foundation for Statistical Computing 314s Platform: aarch64-unknown-linux-gnu 314s 314s R is free software and comes with ABSOLUTELY NO WARRANTY. 314s You are welcome to redistribute it under certain conditions. 314s Type 'license()' or 'licence()' for distribution details. 314s 314s R is a collaborative project with many contributors. 314s Type 'contributors()' for more information and 314s 'citation()' on how to cite R or R packages in publications. 314s 314s Type 'demo()' for some demos, 'help()' for on-line help, or 314s 'help.start()' for an HTML browser interface to help. 314s Type 'q()' to quit R. 314s 314s > ## git2r, R bindings to the libgit2 library. 314s > ## Copyright (C) 2013-2023 The git2r contributors 314s > ## 314s > ## This program is free software; you can redistribute it and/or modify 314s > ## it under the terms of the GNU General Public License, version 2, 314s > ## as published by the Free Software Foundation. 314s > ## 314s > ## git2r is distributed in the hope that it will be useful, 314s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 314s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 314s > ## GNU General Public License for more details. 314s > ## 314s > ## You should have received a copy of the GNU General Public License along 314s > ## with this program; if not, write to the Free Software Foundation, Inc., 314s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 314s > 314s > library(git2r) 314s > 314s > ## For debugging 314s > sessionInfo() 314s R version 4.4.3 (2025-02-28) 314s Platform: aarch64-unknown-linux-gnu 314s Running under: Ubuntu Plucky Puffin (development branch) 314s 314s Matrix products: default 314s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 314s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 314s 314s locale: 314s [1] C 314s 314s time zone: Etc/UTC 314s tzcode source: system (glibc) 314s 314s attached base packages: 314s [1] stats graphics grDevices utils datasets methods base 314s 314s other attached packages: 314s [1] git2r_0.35.0 314s 314s loaded via a namespace (and not attached): 314s [1] compiler_4.4.3 314s > libgit2_version() 314s $major 314s [1] 1 314s 314s $minor 314s [1] 9 314s 314s $rev 314s [1] 0 314s 314s > libgit2_features() 314s $threads 314s [1] TRUE 314s 314s $https 314s [1] TRUE 314s 314s $ssh 314s [1] TRUE 314s 314s > 314s > 314s > ## Create a directory in tempdir 314s > path <- tempfile(pattern = "git2r-") 314s > dir.create(path) 314s > 314s > ## Initialize a repository 314s > repo <- init(path, branch = "main") 314s > config(repo, user.name = "Alice", user.email = "alice@example.org") 314s > 314s > ## Create a file 314s > writeLines("Hello world!", file.path(path, "test.txt")) 314s > 314s > ## add and commit 314s > add(repo, "test.txt") 314s > commit_1 <- commit(repo, "Commit message") 314s > 314s > ## Check branch 314s > stopifnot(identical(length(branches(repo)), 1L)) 314s > stopifnot(identical(is_head(branches(repo)[[1]]), TRUE)) 314s > stopifnot(identical(is_local(branches(repo)[[1]]), TRUE)) 314s > stopifnot(identical(branches(repo)[[1]]$name, "main")) 314s > stopifnot(identical(branches(repo)[[1]], repository_head(repo))) 314s > stopifnot(identical(branches(repo)$main, repository_head(repo))) 314s > 314s > ## Check branch argument 314s > res <- tools::assertError(is_local(1)) 314s > stopifnot(length(grep("argument 'branch' must be a 'git_branch' object", 314s + res[[1]]$message)) > 0) 314s > 314s > ## Check branch name argument 314s > res <- tools::assertError(branch_set_upstream()) 314s > stopifnot(length(grep("Missing argument name", 314s + res[[1]]$message)) > 0) 314s > 314s > ## Print branch 314s > b <- repository_head(repo) 314s > stopifnot(identical(print(b), b)) 314s [5e9aec] (Local) (HEAD) main 314s > 314s > ## Create a branch 314s > b <- branch_create(commit_1, name = "test") 314s > stopifnot(identical(b$name, "test")) 314s > stopifnot(identical(b$type, 1L)) 314s > stopifnot(identical(sha(b), branch_target(b))) 314s > stopifnot(identical(length(branches(repo)), 2L)) 314s > stopifnot(identical(branch_target(branches(repo)[[1]]), 314s + branch_target(branches(repo)[[2]]))) 314s > 314s > ## Check is_branch 314s > stopifnot(identical(is_branch(b), TRUE)) 314s > stopifnot(identical(is_branch(5), FALSE)) 314s > 314s > ## Add one more commit 314s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 314s > add(repo, "test.txt") 314s > commit_2 <- commit(repo, "Another commit message") 314s > 314s > ## Now the first branch should have moved on 314s > stopifnot(!identical(branch_target(branches(repo)[[1]]), 314s + branch_target(branches(repo)[[2]]))) 314s > 314s > ## Create a branch with the same name should fail 314s > tools::assertError(branch_create(commit_2, name = "test")) 314s > 314s > ## Force it and check the branches are identical again 314s > b <- branch_create(commit_2, name = "test", force = TRUE) 314s > stopifnot(identical(branch_target(branches(repo)[[1]]), 314s + branch_target(branches(repo)[[2]]))) 314s > 314s > ## Test arguments 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, NULL)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, 3)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, repo)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > b_tmp <- b 314s > b_tmp$name <- NA_character_ 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > b_tmp <- b 314s > b_tmp$type <- NA_integer_ 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > b_tmp$type <- 3L 314s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 314s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 314s + res[[1]]$message)) > 0) 314s > 314s > ## Delete branch 314s > branch_delete(b) 314s > stopifnot(identical(length(branches(repo)), 1L)) 314s > 314s > ## Add one more commit 314s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world"), 314s + file.path(path, "test.txt")) 314s > add(repo, "test.txt") 314s > commit_3 <- commit(repo, "Another third commit message") 314s > 314s > ## Create and test renaming of branches 314s > b_1 <- branch_create(commit_1, name = "test-1") 314s > b_2 <- branch_create(commit_2, name = "test-2") 314s > b_3 <- branch_create(commit_3, name = "test-3") 314s > stopifnot(identical(length(branches(repo)), 4L)) 314s > b_1 <- branch_rename(b_1, name = "test-1-new-name") 314s > stopifnot(identical(length(branches(repo)), 4L)) 314s > stopifnot(identical(b_1$name, "test-1-new-name")) 314s > tools::assertError(branch_rename(b_1, name = "test-2")) 314s > branch_rename(b_1, name = "test-2", force = TRUE) 314s > stopifnot(identical(length(branches(repo)), 3L)) 314s > 314s > ## Check branches method with missing repo argument 314s > wd <- setwd(path) 314s > stopifnot(identical(length(branches()), 3L)) 314s > if (!is.null(wd)) 314s + setwd(wd) 314s > 314s > ## Cleanup 314s > unlink(path, recursive = TRUE) 314s > 314s BEGIN TEST bundle.R 315s 315s R version 4.4.3 (2025-02-28) -- "Trophy Case" 315s Copyright (C) 2025 The R Foundation for Statistical Computing 315s Platform: aarch64-unknown-linux-gnu 315s 315s R is free software and comes with ABSOLUTELY NO WARRANTY. 315s You are welcome to redistribute it under certain conditions. 315s Type 'license()' or 'licence()' for distribution details. 315s 315s R is a collaborative project with many contributors. 315s Type 'contributors()' for more information and 315s 'citation()' on how to cite R or R packages in publications. 315s 315s Type 'demo()' for some demos, 'help()' for on-line help, or 315s 'help.start()' for an HTML browser interface to help. 315s Type 'q()' to quit R. 315s 315s > ## git2r, R bindings to the libgit2 library. 315s > ## Copyright (C) 2013-2023 The git2r contributors 315s > ## 315s > ## This program is free software; you can redistribute it and/or modify 315s > ## it under the terms of the GNU General Public License, version 2, 315s > ## as published by the Free Software Foundation. 315s > ## 315s > ## git2r is distributed in the hope that it will be useful, 315s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 315s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 315s > ## GNU General Public License for more details. 315s > ## 315s > ## You should have received a copy of the GNU General Public License along 315s > ## with this program; if not, write to the Free Software Foundation, Inc., 315s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 315s > 315s > library("git2r") 315s > 315s > ## For debugging 315s > sessionInfo() 315s R version 4.4.3 (2025-02-28) 315s Platform: aarch64-unknown-linux-gnu 315s Running under: Ubuntu Plucky Puffin (development branch) 315s 315s Matrix products: default 315s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 315s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 315s 315s locale: 315s [1] C 315s 315s time zone: Etc/UTC 315s tzcode source: system (glibc) 315s 315s attached base packages: 315s [1] stats graphics grDevices utils datasets methods base 315s 315s other attached packages: 315s [1] git2r_0.35.0 315s 315s loaded via a namespace (and not attached): 315s [1] compiler_4.4.3 315s > libgit2_version() 315s $major 315s [1] 1 315s 315s $minor 315s [1] 9 315s 315s $rev 315s [1] 0 315s 315s > libgit2_features() 315s $threads 315s [1] TRUE 315s 315s $https 315s [1] TRUE 315s 315s $ssh 315s [1] TRUE 315s 315s > 315s > 315s > ## Create a directory in tempdir 315s > path <- tempfile(pattern = "git2r-") 315s > dir.create(file.path(path, "bundle", "R"), recursive = TRUE) 315s > 315s > ## Initialize a repository 315s > repo <- init(file.path(path, "bundle")) 315s > config(repo, user.name = "Alice", user.email = "alice@example.org") 315s > 315s > ## Create a DESCRIPTION file 315s > writeLines(c( 315s + "package: bundle", 315s + "Title: Bundle Git Repository", 315s + "Description: Bundle a bare repository of the code in the 'inst' folder.", 315s + "Version: 0.1", 315s + "License: GPL-2", 315s + "Authors@R: person('Alice', role = c('aut', 'cre'),", 315s + " email = 'alice@example.org')"), 315s + con = file.path(path, "bundle", "DESCRIPTION")) 315s > add(repo, file.path(path, "bundle", "DESCRIPTION")) 315s > commit(repo, "Add DESCRIPTION file") 315s [5990f71] 2025-03-15: Add DESCRIPTION file 315s > 315s > ## Create R file 315s > writeLines("f <- function(x, y) x+y", 315s + con = file.path(path, "bundle", "R", "bundle.R")) 315s > add(repo, file.path(path, "bundle", "R", "bundle.R")) 315s > commit(repo, "Add R file") 315s [2c3421b] 2025-03-15: Add R file 315s > 315s > ## Bundle package 315s > bundle_r_package(repo) 315s cloning into '/tmp/RtmpFxWP2t/git2r-90c4a172979/bundle/inst/bundle.git'... 315s > 315s > ## Fails if bundled package exists 315s > tools::assertError(bundle_r_package(repo)) 315s > 315s > ## Cleanup 315s > unlink(path, recursive = TRUE) 315s > 315s BEGIN TEST checkout-named-branch.R 315s 315s R version 4.4.3 (2025-02-28) -- "Trophy Case" 315s Copyright (C) 2025 The R Foundation for Statistical Computing 315s Platform: aarch64-unknown-linux-gnu 315s 315s R is free software and comes with ABSOLUTELY NO WARRANTY. 315s You are welcome to redistribute it under certain conditions. 315s Type 'license()' or 'licence()' for distribution details. 315s 315s R is a collaborative project with many contributors. 315s Type 'contributors()' for more information and 315s 'citation()' on how to cite R or R packages in publications. 315s 315s Type 'demo()' for some demos, 'help()' for on-line help, or 315s 'help.start()' for an HTML browser interface to help. 315s Type 'q()' to quit R. 315s 315s > ## git2r, R bindings to the libgit2 library. 315s > ## Copyright (C) 2013-2023 The git2r contributors 315s > ## 315s > ## This program is free software; you can redistribute it and/or modify 315s > ## it under the terms of the GNU General Public License, version 2, 315s > ## as published by the Free Software Foundation. 315s > ## 315s > ## git2r is distributed in the hope that it will be useful, 315s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 315s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 315s > ## GNU General Public License for more details. 315s > ## 315s > ## You should have received a copy of the GNU General Public License along 315s > ## with this program; if not, write to the Free Software Foundation, Inc., 315s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 315s > 315s > library(git2r) 315s > 315s > ## For debugging 315s > sessionInfo() 315s R version 4.4.3 (2025-02-28) 315s Platform: aarch64-unknown-linux-gnu 315s Running under: Ubuntu Plucky Puffin (development branch) 315s 315s Matrix products: default 315s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 315s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 315s 315s locale: 315s [1] C 315s 315s time zone: Etc/UTC 315s tzcode source: system (glibc) 315s 315s attached base packages: 315s [1] stats graphics grDevices utils datasets methods base 315s 315s other attached packages: 315s [1] git2r_0.35.0 315s 315s loaded via a namespace (and not attached): 315s [1] compiler_4.4.3 315s > libgit2_version() 315s $major 315s [1] 1 315s 315s $minor 315s [1] 9 315s 315s $rev 315s [1] 0 315s 315s > libgit2_features() 315s $threads 315s [1] TRUE 315s 315s $https 315s [1] TRUE 315s 315s $ssh 315s [1] TRUE 315s 315s > 315s > 315s > ## Create directories for repositories in tempdir 315s > path_bare <- tempfile(pattern = "git2r-") 315s > path_repo_1 <- tempfile(pattern = "git2r-") 315s > path_repo_2 <- tempfile(pattern = "git2r-") 315s > 315s > dir.create(path_bare) 315s > dir.create(path_repo_1) 315s > dir.create(path_repo_2) 315s > 315s > ## Create bare repository 315s > bare_repo <- init(path_bare, bare = TRUE) 315s > 315s > ## Clone to repo 1 315s > repo_1 <- clone(path_bare, path_repo_1) 315s cloning into '/tmp/RtmpynK6iV/git2r-91826cb50c9'... 315s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 315s > 315s > ## Add changes to repo 1 and push to bare 315s > writeLines( 315s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 315s + con = file.path(path_repo_1, "test.txt")) 315s > add(repo_1, "test.txt") 315s > commit(repo_1, "First commit message") 315s [c962ae2] 2025-03-15: First commit message 315s > branch_name <- branches(repo_1)[[1]]$name 315s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 315s > 315s > ## Test checkout branch argument 315s > tools::assertError(checkout(repo_1)) 315s > tools::assertError(checkout(repo_1, c("master", "master"))) 315s > tools::assertError(checkout(repo_1, "dev")) 315s > 315s > ## Create and checkout dev branch in repo 1 315s > checkout(repo_1, "dev", create = TRUE) 315s > 315s > ## Add changes to dev branch in repo 1 and push to bare 315s > writeLines( 315s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 315s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 315s + con = file.path(path_repo_1, "test.txt")) 315s > add(repo_1, "test.txt") 315s > commit(repo_1, "Second commit message") 315s [64c5e9f] 2025-03-15: Second commit message 315s > push(repo_1, "origin", "refs/heads/dev") 315s > 315s > ## Clone to repo 2 315s > repo_2 <- clone(path_bare, path_repo_2) 315s cloning into '/tmp/RtmpynK6iV/git2r-9182411ae67'... 315s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 315s > 315s > stopifnot(identical( 315s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 315s + readLines(file.path(path_repo_2, "test.txt")))) 315s > 315s > ## Checkout dev branch 315s > checkout(repo_2, "dev") 315s > 315s > ## Check content of file 315s > stopifnot(identical( 315s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 315s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 315s + readLines(file.path(path_repo_2, "test.txt")))) 315s > 315s > ## Checkout previous branch 315s > checkout(repo_2, "-") 315s > stopifnot(identical(repository_head(repo_2)$name, branch_name)) 315s > 315s > ## Cleanup 315s > unlink(path_bare, recursive = TRUE) 315s > unlink(path_repo_1, recursive = TRUE) 315s > unlink(path_repo_2, recursive = TRUE) 315s > 315s BEGIN TEST checkout.R 315s 315s R version 4.4.3 (2025-02-28) -- "Trophy Case" 315s Copyright (C) 2025 The R Foundation for Statistical Computing 315s Platform: aarch64-unknown-linux-gnu 315s 315s R is free software and comes with ABSOLUTELY NO WARRANTY. 315s You are welcome to redistribute it under certain conditions. 315s Type 'license()' or 'licence()' for distribution details. 315s 315s R is a collaborative project with many contributors. 315s Type 'contributors()' for more information and 315s 'citation()' on how to cite R or R packages in publications. 315s 315s Type 'demo()' for some demos, 'help()' for on-line help, or 315s 'help.start()' for an HTML browser interface to help. 315s Type 'q()' to quit R. 315s 315s > ## git2r, R bindings to the libgit2 library. 315s > ## Copyright (C) 2013-2023 The git2r contributors 315s > ## 315s > ## This program is free software; you can redistribute it and/or modify 315s > ## it under the terms of the GNU General Public License, version 2, 315s > ## as published by the Free Software Foundation. 315s > ## 315s > ## git2r is distributed in the hope that it will be useful, 315s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 315s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 315s > ## GNU General Public License for more details. 315s > ## 315s > ## You should have received a copy of the GNU General Public License along 315s > ## with this program; if not, write to the Free Software Foundation, Inc., 315s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 315s > 315s > library(git2r) 315s > 315s > ## For debugging 315s > sessionInfo() 315s R version 4.4.3 (2025-02-28) 315s Platform: aarch64-unknown-linux-gnu 315s Running under: Ubuntu Plucky Puffin (development branch) 315s 315s Matrix products: default 315s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 315s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 315s 315s locale: 315s [1] C 315s 315s time zone: Etc/UTC 315s tzcode source: system (glibc) 315s 315s attached base packages: 315s [1] stats graphics grDevices utils datasets methods base 315s 315s other attached packages: 315s [1] git2r_0.35.0 315s 315s loaded via a namespace (and not attached): 315s [1] compiler_4.4.3 315s > libgit2_version() 315s $major 315s [1] 1 315s 315s $minor 315s [1] 9 315s 315s $rev 315s [1] 0 315s 315s > libgit2_features() 315s $threads 315s [1] TRUE 315s 315s $https 315s [1] TRUE 315s 315s $ssh 315s [1] TRUE 315s 315s > 315s > 315s > ## Create a directory in tempdir 315s > path <- tempfile(pattern = "git2r-") 315s > dir.create(path) 315s > 315s > ## Initialize a repository 315s > repo <- init(path, branch = "main") 315s > config(repo, user.name = "Alice", user.email = "alice@example.org") 315s > 315s > ## Create first commit 315s > writeLines("Hello world!", file.path(path, "test.txt")) 315s > add(repo, "test.txt") 315s > commit_1 <- commit(repo, "First commit message") 315s > 315s > ## Edit file and checkout 315s > writeLines(c("Hello world!", "Hello world!"), file.path(path, "test.txt")) 315s > status_exp_1 <- structure(list(staged = structure(list(), 315s + .Names = character(0)), 315s + unstaged = structure(list(modified = "test.txt"), 315s + .Names = "modified"), 315s + untracked = structure(list(), 315s + .Names = character(0))), 315s + .Names = c("staged", "unstaged", "untracked"), 315s + class = "git_status") 315s > status_obs_1 <- status(repo) 315s > str(status_exp_1) 315s List of 3 315s $ staged : Named list() 315s $ unstaged :List of 1 315s ..$ modified: chr "test.txt" 315s $ untracked: Named list() 315s - attr(*, "class")= chr "git_status" 315s > str(status_obs_1) 315s List of 3 315s $ staged : Named list() 315s $ unstaged :List of 1 315s ..$ modified: chr "test.txt" 315s $ untracked: Named list() 315s - attr(*, "class")= chr "git_status" 315s > stopifnot(identical(status_obs_1, status_exp_1)) 315s > checkout(repo, path = "test.txt") 315s > status_exp_2 <- structure(list(staged = structure(list(), 315s + .Names = character(0)), 315s + unstaged = structure(list(), 315s + .Names = character(0)), 315s + untracked = structure(list(), 315s + .Names = character(0))), 315s + .Names = c("staged", "unstaged", "untracked"), 315s + class = "git_status") 315s > status_obs_2 <- status(repo) 315s > str(status_exp_2) 315s List of 3 315s $ staged : Named list() 315s $ unstaged : Named list() 315s $ untracked: Named list() 315s - attr(*, "class")= chr "git_status" 315s > str(status_obs_2) 315s List of 3 315s $ staged : Named list() 315s $ unstaged : Named list() 315s $ untracked: Named list() 315s - attr(*, "class")= chr "git_status" 315s > stopifnot(identical(status_obs_2, status_exp_2)) 315s > 315s > ## Create second commit 315s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 315s > add(repo, "test.txt") 315s > commit_2 <- commit(repo, "Second commit message") 315s > tag(repo, "commit_2", "Tag message") 315s > 315s > ## Create third commit 315s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 315s + file.path(path, "test.txt")) 315s > add(repo, "test.txt") 315s > commit_3 <- commit(repo, "Third commit message") 315s > 315s > ## Check HEAD 315s > stopifnot(identical(is_detached(repo), FALSE)) 315s > stopifnot(identical(repository_head(repo)$name, "main")) 315s > 315s > ## Check show and summary 315s > repo 315s Local: main /tmp/RtmpvUI9Zw/git2r-9242a111554 315s Head: [22b1f8d] 2025-03-15: Third commit message 315s > summary(repo) 315s Local: main /tmp/RtmpvUI9Zw/git2r-9242a111554 315s Head: [22b1f8d] 2025-03-15: Third commit message 315s 315s Branches: 1 315s Tags: 1 315s Commits: 3 315s Contributors: 1 315s Stashes: 0 315s Ignored files: 0 315s Untracked files: 0 315s Unstaged files: 0 315s Staged files: 0 315s 315s Latest commits: 315s [22b1f8d] 2025-03-15: Third commit message 315s [0f3c759] 2025-03-15: Second commit message 315s [f17bbc0] 2025-03-15: First commit message 315s > 315s > ## Checkout first commit 315s > checkout(commit_1, TRUE) 315s > stopifnot(identical(is_detached(repo), TRUE)) 315s > stopifnot(identical(repository_head(repo), commit_1)) 315s > stopifnot(identical(readLines(file.path(path, "test.txt")), "Hello world!")) 315s > 315s > ## Check show and summary 315s > repo 315s Local: (detached) /tmp/RtmpvUI9Zw/git2r-9242a111554 315s Head: [f17bbc0] 2025-03-15: First commit message 315s > summary(repo) 315s Local: (detached) /tmp/RtmpvUI9Zw/git2r-9242a111554 315s Head: [f17bbc0] 2025-03-15: First commit message 315s 315s Branches: 1 315s Tags: 1 315s Commits: 1 315s Contributors: 1 315s Stashes: 0 315s Ignored files: 0 315s Untracked files: 0 315s Unstaged files: 0 315s Staged files: 0 315s 315s Latest commits: 315s [f17bbc0] 2025-03-15: First commit message 315s > 315s > ## Checkout tag 315s > checkout(tags(repo)[[1]], TRUE) 315s > stopifnot(identical(is_detached(repo), TRUE)) 315s > stopifnot(identical(readLines(file.path(path, "test.txt")), 315s + c("Hello world!", "HELLO WORLD!"))) 315s > 315s > ## Check is_detached with missing repo argument 315s > wd <- setwd(path) 315s > stopifnot(identical(is_detached(), TRUE)) 315s > if (!is.null(wd)) 315s + setwd(wd) 315s > 315s > ## Cleanup 315s > unlink(path, recursive = TRUE) 315s > 315s BEGIN TEST checkout_branch.R 315s 315s R version 4.4.3 (2025-02-28) -- "Trophy Case" 315s Copyright (C) 2025 The R Foundation for Statistical Computing 315s Platform: aarch64-unknown-linux-gnu 315s 315s R is free software and comes with ABSOLUTELY NO WARRANTY. 315s You are welcome to redistribute it under certain conditions. 315s Type 'license()' or 'licence()' for distribution details. 315s 315s R is a collaborative project with many contributors. 315s Type 'contributors()' for more information and 315s 'citation()' on how to cite R or R packages in publications. 315s 315s Type 'demo()' for some demos, 'help()' for on-line help, or 315s 'help.start()' for an HTML browser interface to help. 315s Type 'q()' to quit R. 315s 316s > ## git2r, R bindings to the libgit2 library. 316s > ## Copyright (C) 2013-2023 The git2r contributors 316s > ## 316s > ## This program is free software; you can redistribute it and/or modify 316s > ## it under the terms of the GNU General Public License, version 2, 316s > ## as published by the Free Software Foundation. 316s > ## 316s > ## git2r is distributed in the hope that it will be useful, 316s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 316s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 316s > ## GNU General Public License for more details. 316s > ## 316s > ## You should have received a copy of the GNU General Public License along 316s > ## with this program; if not, write to the Free Software Foundation, Inc., 316s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 316s > 316s > library(git2r) 316s > 316s > ## For debugging 316s > sessionInfo() 316s R version 4.4.3 (2025-02-28) 316s Platform: aarch64-unknown-linux-gnu 316s Running under: Ubuntu Plucky Puffin (development branch) 316s 316s Matrix products: default 316s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 316s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 316s 316s locale: 316s [1] C 316s 316s time zone: Etc/UTC 316s tzcode source: system (glibc) 316s 316s attached base packages: 316s [1] stats graphics grDevices utils datasets methods base 316s 316s other attached packages: 316s [1] git2r_0.35.0 316s 316s loaded via a namespace (and not attached): 316s [1] compiler_4.4.3 316s > libgit2_version() 316s $major 316s [1] 1 316s 316s $minor 316s [1] 9 316s 316s $rev 316s [1] 0 316s 316s > libgit2_features() 316s $threads 316s [1] TRUE 316s 316s $https 316s [1] TRUE 316s 316s $ssh 316s [1] TRUE 316s 316s > 316s > 316s > ## Create a directory in tempdir 316s > path <- tempfile(pattern = "git2r-") 316s > dir.create(path) 316s > 316s > ## Initialize a repository 316s > repo <- init(path, branch = "main") 316s > config(repo, user.name = "Alice", user.email = "alice@example.org") 316s > 316s > ## Create first commit 316s > writeLines("Hello world!", file.path(path, "test-1.txt")) 316s > add(repo, "test-1.txt") 316s > commit(repo, "First commit message") 316s [1dad532] 2025-03-15: First commit message 316s > 316s > ## Create and checkout dev branch in repo 316s > checkout(repo, "dev", create = TRUE) 316s > 316s > ## Create second commit 316s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 316s > add(repo, "test-2.txt") 316s > commit(repo, "Second commit message") 316s [913e802] 2025-03-15: Second commit message 316s > 316s > ## Check files 316s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 316s > 316s > ## Checkout master branch and check files 316s > checkout(repo, "main") 316s > stopifnot(identical(list.files(path), "test-1.txt")) 316s > 316s > ## Cleanup 316s > unlink(path, recursive = TRUE) 316s > 316s > ## Checkout branch in empty repository 316s > 316s > ## Create a directory in tempdir 316s > path <- tempfile(pattern = "git2r-") 316s > dir.create(path) 316s > 316s > ## Initialize a repository 316s > repo <- init(path) 316s > config(repo, user.name = "Alice", user.email = "alice@example.org") 316s > 316s > ## Create and checkout dev branch in repo 316s > checkout(repo, "dev", create = TRUE) 316s > 316s > ## Create first commit 316s > writeLines("Hello world!", file.path(path, "test-1.txt")) 316s > add(repo, "test-1.txt") 316s > commit(repo, "First commit message") 316s [1dad532] 2025-03-15: First commit message 316s > 316s > stopifnot(identical(length(branches(repo)), 1L)) 316s > stopifnot(identical(branches(repo)[[1]]$name, "dev")) 316s > 316s > ## Cleanup 316s > unlink(path, recursive = TRUE) 316s > 316s BEGIN TEST checkout_commit.R 316s 316s R version 4.4.3 (2025-02-28) -- "Trophy Case" 316s Copyright (C) 2025 The R Foundation for Statistical Computing 316s Platform: aarch64-unknown-linux-gnu 316s 316s R is free software and comes with ABSOLUTELY NO WARRANTY. 316s You are welcome to redistribute it under certain conditions. 316s Type 'license()' or 'licence()' for distribution details. 316s 316s R is a collaborative project with many contributors. 316s Type 'contributors()' for more information and 316s 'citation()' on how to cite R or R packages in publications. 316s 316s Type 'demo()' for some demos, 'help()' for on-line help, or 316s 'help.start()' for an HTML browser interface to help. 316s Type 'q()' to quit R. 316s 316s > ## git2r, R bindings to the libgit2 library. 316s > ## Copyright (C) 2013-2023 The git2r contributors 316s > ## 316s > ## This program is free software; you can redistribute it and/or modify 316s > ## it under the terms of the GNU General Public License, version 2, 316s > ## as published by the Free Software Foundation. 316s > ## 316s > ## git2r is distributed in the hope that it will be useful, 316s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 316s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 316s > ## GNU General Public License for more details. 316s > ## 316s > ## You should have received a copy of the GNU General Public License along 316s > ## with this program; if not, write to the Free Software Foundation, Inc., 316s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 316s > 316s > library("git2r") 316s > 316s > ## For debugging 316s > sessionInfo() 316s R version 4.4.3 (2025-02-28) 316s Platform: aarch64-unknown-linux-gnu 316s Running under: Ubuntu Plucky Puffin (development branch) 316s 316s Matrix products: default 316s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 316s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 316s 316s locale: 316s [1] C 316s 316s time zone: Etc/UTC 316s tzcode source: system (glibc) 316s 316s attached base packages: 316s [1] stats graphics grDevices utils datasets methods base 316s 316s other attached packages: 316s [1] git2r_0.35.0 316s 316s loaded via a namespace (and not attached): 316s [1] compiler_4.4.3 316s > libgit2_version() 316s $major 316s [1] 1 316s 316s $minor 316s [1] 9 316s 316s $rev 316s [1] 0 316s 316s > libgit2_features() 316s $threads 316s [1] TRUE 316s 316s $https 316s [1] TRUE 316s 316s $ssh 316s [1] TRUE 316s 316s > 316s > 316s > ## Create a directory in tempdir 316s > path <- tempfile(pattern = "git2r-") 316s > dir.create(path) 316s > 316s > ## Initialize a repository 316s > repo <- init(path) 316s > config(repo, user.name = "Alice", user.email = "alice@example.org") 316s > 316s > ## Create first commit 316s > writeLines("Hello world!", file.path(path, "test-1.txt")) 316s > add(repo, "test-1.txt") 316s > commit_1 <- commit(repo, "First commit message") 316s > 316s > ## Create and checkout dev branch in repo 316s > checkout(repo, "dev", create = TRUE) 316s > 316s > ## Create second commit 316s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 316s > add(repo, "test-2.txt") 316s > commit_2 <- commit(repo, "Second commit message") 316s > 316s > ## Check files 316s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 316s > 316s > ## Checkout commit_1 and check files 316s > checkout(commit_1) 316s > stopifnot(identical(list.files(path), "test-1.txt")) 316s > 316s > ## Checkout commit_2 and check files 316s > checkout(commit_2) 316s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 316s > 316s > ## Cleanup 316s > unlink(path, recursive = TRUE) 316s > 316s BEGIN TEST checkout_tag.R 316s 316s R version 4.4.3 (2025-02-28) -- "Trophy Case" 316s Copyright (C) 2025 The R Foundation for Statistical Computing 316s Platform: aarch64-unknown-linux-gnu 316s 316s R is free software and comes with ABSOLUTELY NO WARRANTY. 316s You are welcome to redistribute it under certain conditions. 316s Type 'license()' or 'licence()' for distribution details. 316s 316s R is a collaborative project with many contributors. 316s Type 'contributors()' for more information and 316s 'citation()' on how to cite R or R packages in publications. 316s 316s Type 'demo()' for some demos, 'help()' for on-line help, or 316s 'help.start()' for an HTML browser interface to help. 316s Type 'q()' to quit R. 316s 316s > ## git2r, R bindings to the libgit2 library. 316s > ## Copyright (C) 2013-2023 The git2r contributors 316s > ## 316s > ## This program is free software; you can redistribute it and/or modify 316s > ## it under the terms of the GNU General Public License, version 2, 316s > ## as published by the Free Software Foundation. 316s > ## 316s > ## git2r is distributed in the hope that it will be useful, 316s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 316s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 316s > ## GNU General Public License for more details. 316s > ## 316s > ## You should have received a copy of the GNU General Public License along 316s > ## with this program; if not, write to the Free Software Foundation, Inc., 316s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 316s > 316s > library(git2r) 316s > 316s > ## For debugging 316s > sessionInfo() 316s R version 4.4.3 (2025-02-28) 316s Platform: aarch64-unknown-linux-gnu 316s Running under: Ubuntu Plucky Puffin (development branch) 316s 316s Matrix products: default 316s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 316s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 316s 316s locale: 316s [1] C 316s 316s time zone: Etc/UTC 316s tzcode source: system (glibc) 316s 316s attached base packages: 316s [1] stats graphics grDevices utils datasets methods base 316s 316s other attached packages: 316s [1] git2r_0.35.0 316s 316s loaded via a namespace (and not attached): 316s [1] compiler_4.4.3 316s > libgit2_version() 316s $major 316s [1] 1 316s 316s $minor 316s [1] 9 316s 316s $rev 316s [1] 0 316s 316s > libgit2_features() 316s $threads 316s [1] TRUE 316s 316s $https 316s [1] TRUE 316s 316s $ssh 316s [1] TRUE 316s 316s > 316s > 316s > ## Create a directory in tempdir 316s > path <- tempfile(pattern = "git2r-") 316s > dir.create(path) 316s > 316s > ## Initialize a repository 316s > repo <- init(path) 316s > config(repo, user.name = "Alice", user.email = "alice@example.org") 316s > 316s > ## Create first commit 316s > writeLines("Hello world!", file.path(path, "test-1.txt")) 316s > add(repo, "test-1.txt") 316s > commit_1 <- commit(repo, "First commit message") 316s > tag_1 <- tag(repo, "Tag1", "First tag message") 316s > 316s > ## Create and checkout dev branch in repo 316s > checkout(repo, "dev", create = TRUE) 316s > 316s > ## Create second commit 316s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 316s > add(repo, "test-2.txt") 316s > commit_2 <- commit(repo, "Second commit message") 316s > tag_2 <- tag(repo, "Tag2", "Second tag message") 316s > 316s > ## Check files 316s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 316s > 316s > ## Checkout tag_1 and check files 316s > checkout(tag_1) 316s > stopifnot(identical(list.files(path), "test-1.txt")) 316s > 316s > ## Checkout tag_2 and check files 316s > checkout(tag_2) 316s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 316s > 316s > ## Checkout "Tag1" and check files 316s > checkout(repo, "Tag1") 316s > stopifnot(identical(list.files(path), "test-1.txt")) 316s > 316s > ## Cleanup 316s > unlink(path, recursive = TRUE) 316s > 316s BEGIN TEST clone_bare.R 316s 316s R version 4.4.3 (2025-02-28) -- "Trophy Case" 316s Copyright (C) 2025 The R Foundation for Statistical Computing 316s Platform: aarch64-unknown-linux-gnu 316s 316s R is free software and comes with ABSOLUTELY NO WARRANTY. 316s You are welcome to redistribute it under certain conditions. 316s Type 'license()' or 'licence()' for distribution details. 316s 316s R is a collaborative project with many contributors. 316s Type 'contributors()' for more information and 316s 'citation()' on how to cite R or R packages in publications. 316s 316s Type 'demo()' for some demos, 'help()' for on-line help, or 316s 'help.start()' for an HTML browser interface to help. 316s Type 'q()' to quit R. 316s 316s > ## git2r, R bindings to the libgit2 library. 316s > ## Copyright (C) 2013-2023 The git2r contributors 316s > ## 316s > ## This program is free software; you can redistribute it and/or modify 316s > ## it under the terms of the GNU General Public License, version 2, 316s > ## as published by the Free Software Foundation. 316s > ## 316s > ## git2r is distributed in the hope that it will be useful, 316s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 316s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 316s > ## GNU General Public License for more details. 316s > ## 316s > ## You should have received a copy of the GNU General Public License along 316s > ## with this program; if not, write to the Free Software Foundation, Inc., 316s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 316s > 316s > library("git2r") 316s > 316s > ## For debugging 316s > sessionInfo() 316s R version 4.4.3 (2025-02-28) 316s Platform: aarch64-unknown-linux-gnu 316s Running under: Ubuntu Plucky Puffin (development branch) 316s 316s Matrix products: default 316s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 316s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 316s 316s locale: 316s [1] C 316s 316s time zone: Etc/UTC 316s tzcode source: system (glibc) 316s 316s attached base packages: 316s [1] stats graphics grDevices utils datasets methods base 316s 316s other attached packages: 316s [1] git2r_0.35.0 316s 316s loaded via a namespace (and not attached): 316s [1] compiler_4.4.3 316s > libgit2_version() 316s $major 316s [1] 1 316s 316s $minor 316s [1] 9 316s 316s $rev 316s [1] 0 316s 316s > libgit2_features() 316s $threads 316s [1] TRUE 316s 316s $https 316s [1] TRUE 316s 316s $ssh 316s [1] TRUE 316s 316s > 316s > 316s > ## Create 2 directories in tempdir 316s > path_bare <- tempfile(pattern = "git2r-") 316s > path_repo <- tempfile(pattern = "git2r-") 316s > dir.create(path_bare) 316s > dir.create(path_repo) 316s > 316s > ## Initialize a repository 316s > repo <- init(path_repo) 316s > config(repo, user.name = "Alice", user.email = "alice@example.org") 316s > 316s > ## Add commit to repo 316s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 316s > add(repo, "test.txt") 316s > commit_1 <- commit(repo, "Commit message") 316s > 316s > ## Check bare argument 316s > tools::assertError(clone(path_repo, path_bare, bare = c(TRUE, TRUE))) 316s > tools::assertError(clone(path_repo, path_bare, bare = 1)) 316s > tools::assertError(clone(path_repo, path_bare, bare = 1L)) 316s > tools::assertError(clone(path_repo, path_bare, bare = "test")) 316s > 316s > ## Clone repo to bare repository 316s > bare_repo <- clone(path_repo, path_bare, bare = TRUE) 316s cloning into '/tmp/Rtmp5kQABg/git2r-9542cc6de55'... 316s > 316s > ## Check the repositores 316s > stopifnot(identical(is_bare(bare_repo), TRUE)) 316s > stopifnot(identical(is_bare(repo), FALSE)) 316s > 316s > ## Check result in bare repository 316s > stopifnot(identical(length(commits(bare_repo)), 1L)) 316s > bare_commit_1 <- commits(bare_repo)[[1]] 316s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 316s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 316s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 316s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 316s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 316s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 316s > 316s > ## Cleanup 316s > unlink(path_bare, recursive = TRUE) 316s > unlink(path_repo, recursive = TRUE) 316s > 316s BEGIN TEST clone_branch.R 316s 316s R version 4.4.3 (2025-02-28) -- "Trophy Case" 316s Copyright (C) 2025 The R Foundation for Statistical Computing 316s Platform: aarch64-unknown-linux-gnu 316s 316s R is free software and comes with ABSOLUTELY NO WARRANTY. 316s You are welcome to redistribute it under certain conditions. 316s Type 'license()' or 'licence()' for distribution details. 316s 316s R is a collaborative project with many contributors. 316s Type 'contributors()' for more information and 316s 'citation()' on how to cite R or R packages in publications. 316s 316s Type 'demo()' for some demos, 'help()' for on-line help, or 316s 'help.start()' for an HTML browser interface to help. 316s Type 'q()' to quit R. 316s 317s > ## git2r, R bindings to the libgit2 library. 317s > ## Copyright (C) 2013-2023 The git2r contributors 317s > ## 317s > ## This program is free software; you can redistribute it and/or modify 317s > ## it under the terms of the GNU General Public License, version 2, 317s > ## as published by the Free Software Foundation. 317s > ## 317s > ## git2r is distributed in the hope that it will be useful, 317s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 317s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 317s > ## GNU General Public License for more details. 317s > ## 317s > ## You should have received a copy of the GNU General Public License along 317s > ## with this program; if not, write to the Free Software Foundation, Inc., 317s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 317s > 317s > library(git2r) 317s > 317s > ## For debugging 317s > sessionInfo() 317s R version 4.4.3 (2025-02-28) 317s Platform: aarch64-unknown-linux-gnu 317s Running under: Ubuntu Plucky Puffin (development branch) 317s 317s Matrix products: default 317s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 317s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 317s 317s locale: 317s [1] C 317s 317s time zone: Etc/UTC 317s tzcode source: system (glibc) 317s 317s attached base packages: 317s [1] stats graphics grDevices utils datasets methods base 317s 317s other attached packages: 317s [1] git2r_0.35.0 317s 317s loaded via a namespace (and not attached): 317s [1] compiler_4.4.3 317s > libgit2_version() 317s $major 317s [1] 1 317s 317s $minor 317s [1] 9 317s 317s $rev 317s [1] 0 317s 317s > libgit2_features() 317s $threads 317s [1] TRUE 317s 317s $https 317s [1] TRUE 317s 317s $ssh 317s [1] TRUE 317s 317s > 317s > 317s > ## Create directories for repositories in tempdir 317s > path_bare <- tempfile(pattern = "git2r-") 317s > path_repo_1 <- tempfile(pattern = "git2r-") 317s > path_repo_2 <- tempfile(pattern = "git2r-") 317s > 317s > dir.create(path_bare) 317s > dir.create(path_repo_1) 317s > dir.create(path_repo_2) 317s > 317s > ## Create bare repository 317s > bare_repo <- init(path_bare, bare = TRUE) 317s > 317s > ## Clone to repo 1 317s > repo_1 <- clone(path_bare, path_repo_1) 317s cloning into '/tmp/RtmpZBb8Vw/git2r-9605c7bc6be'... 317s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 317s > 317s > ## Add changes to repo 1 317s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 317s + con = file.path(path_repo_1, "test-1.txt")) 317s > add(repo_1, "test-1.txt") 317s > commit_1 <- commit(repo_1, "First commit message") 317s > branch_name <- branches(repo_1)[[1]]$name 317s > 317s > ## Create 'dev' branch 317s > checkout(branch_create(commit_1, name = "dev")) 317s > 317s > ## Add more changes to repo 1 317s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 317s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 317s + con = file.path(path_repo_1, "test-1.txt")) 317s > add(repo_1, "test-1.txt") 317s > commit(repo_1, "Second commit message") 317s [e2a7f09] 2025-03-15: Second commit message 317s > 317s > ## Add more changes to repo 1 317s > writeLines( 317s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 317s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 317s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 317s + con = file.path(path_repo_1, "test-1.txt")) 317s > add(repo_1, "test-1.txt") 317s > commit(repo_1, "Third commit message") 317s [d6f40de] 2025-03-15: Third commit message 317s > 317s > ## Push to bare 317s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 317s > push(repo_1, "origin", "refs/heads/dev") 317s > 317s > ## Print branch 317s > branches(repo_1)[[paste0("origin/", branch_name)]] 317s [95aafa] (origin @ /tmp/RtmpZBb8Vw/git2r-9602edf6765) master 317s > 317s > ## Clone to repo 2 317s > repo_2 <- clone(url = path_bare, local_path = path_repo_2, branch = "dev") 317s cloning into '/tmp/RtmpZBb8Vw/git2r-96013b0b821'... 317s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 317s > 317s > ## Check branch and commits 317s > stopifnot(identical(length(commits(repo_2)), 3L)) 317s > stopifnot(identical(repository_head(repo_2)$name, "dev")) 317s > 317s > ## Cleanup 317s > unlink(path_bare, recursive = TRUE) 317s > unlink(path_repo_1, recursive = TRUE) 317s > unlink(path_repo_2, recursive = TRUE) 317s > 317s BEGIN TEST clone_checkout.R 317s 317s R version 4.4.3 (2025-02-28) -- "Trophy Case" 317s Copyright (C) 2025 The R Foundation for Statistical Computing 317s Platform: aarch64-unknown-linux-gnu 317s 317s R is free software and comes with ABSOLUTELY NO WARRANTY. 317s You are welcome to redistribute it under certain conditions. 317s Type 'license()' or 'licence()' for distribution details. 317s 317s R is a collaborative project with many contributors. 317s Type 'contributors()' for more information and 317s 'citation()' on how to cite R or R packages in publications. 317s 317s Type 'demo()' for some demos, 'help()' for on-line help, or 317s 'help.start()' for an HTML browser interface to help. 317s Type 'q()' to quit R. 317s 317s > ## git2r, R bindings to the libgit2 library. 317s > ## Copyright (C) 2013-2023 The git2r contributors 317s > ## 317s > ## This program is free software; you can redistribute it and/or modify 317s > ## it under the terms of the GNU General Public License, version 2, 317s > ## as published by the Free Software Foundation. 317s > ## 317s > ## git2r is distributed in the hope that it will be useful, 317s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 317s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 317s > ## GNU General Public License for more details. 317s > ## 317s > ## You should have received a copy of the GNU General Public License along 317s > ## with this program; if not, write to the Free Software Foundation, Inc., 317s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 317s > 317s > library("git2r") 317s > 317s > ## For debugging 317s > sessionInfo() 317s R version 4.4.3 (2025-02-28) 317s Platform: aarch64-unknown-linux-gnu 317s Running under: Ubuntu Plucky Puffin (development branch) 317s 317s Matrix products: default 317s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 317s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 317s 317s locale: 317s [1] C 317s 317s time zone: Etc/UTC 317s tzcode source: system (glibc) 317s 317s attached base packages: 317s [1] stats graphics grDevices utils datasets methods base 317s 317s other attached packages: 317s [1] git2r_0.35.0 317s 317s loaded via a namespace (and not attached): 317s [1] compiler_4.4.3 317s > libgit2_version() 317s $major 317s [1] 1 317s 317s $minor 317s [1] 9 317s 317s $rev 317s [1] 0 317s 317s > libgit2_features() 317s $threads 317s [1] TRUE 317s 317s $https 317s [1] TRUE 317s 317s $ssh 317s [1] TRUE 317s 317s > 317s > 317s > ## Create 2 directories in tempdir 317s > path_src <- tempfile(pattern = "git2r-") 317s > path_tgt <- tempfile(pattern = "git2r-") 317s > dir.create(path_tgt) 317s > dir.create(path_src) 317s > 317s > ## Initialize a repository 317s > repo_src <- init(path_src) 317s > config(repo_src, user.name = "Alice", user.email = "alice@example.org") 317s > 317s > ## Add commit to repo 317s > filename <- "test.txt" 317s > writeLines("Hello world", con = file.path(path_src, filename)) 317s > add(repo_src, "test.txt") 317s > commit_src <- commit(repo_src, "Commit message") 317s > 317s > ## Check checkout argument 317s > tools::assertError(clone(path_src, path_tgt, checkout = c(FALSE, TRUE))) 317s > tools::assertError(clone(path_src, path_tgt, checkout = 1)) 317s > tools::assertError(clone(path_src, path_tgt, checkout = 1L)) 317s > tools::assertError(clone(path_src, path_tgt, checkout = "test")) 317s > 317s > ## Clone source to target repository without checking out any files 317s > repo_tgt <- clone(path_src, path_tgt, checkout = FALSE) 317s cloning into '/tmp/Rtmp1WNRPE/git2r-96c46087467'... 317s > 317s > ## List files in the repositores 317s > stopifnot(identical(list.files(path_src), filename)) 317s > stopifnot(identical(list.files(path_tgt), character(0))) 317s > 317s > ## Compare commits 317s > stopifnot(identical(length(commits(repo_tgt)), 1L)) 317s > commit_tgt <- last_commit(repo_tgt) 317s > stopifnot(identical(sha(last_commit(path_tgt)), sha(commit_tgt))) 317s > stopifnot(identical(sha(commit_src), sha(commit_tgt))) 317s > stopifnot(identical(commit_src$author, commit_tgt$author)) 317s > stopifnot(identical(commit_src$committer, commit_tgt$committer)) 317s > stopifnot(identical(commit_src$summary, commit_tgt$summary)) 317s > stopifnot(identical(commit_src$message, commit_tgt$message)) 317s > stopifnot(!identical(commit_src$repo, commit_tgt$repo)) 317s > 317s > ## Cleanup 317s > unlink(path_tgt, recursive = TRUE) 317s > unlink(path_src, recursive = TRUE) 317s > 317s BEGIN TEST commit.R 317s 317s R version 4.4.3 (2025-02-28) -- "Trophy Case" 317s Copyright (C) 2025 The R Foundation for Statistical Computing 317s Platform: aarch64-unknown-linux-gnu 317s 317s R is free software and comes with ABSOLUTELY NO WARRANTY. 317s You are welcome to redistribute it under certain conditions. 317s Type 'license()' or 'licence()' for distribution details. 317s 317s R is a collaborative project with many contributors. 317s Type 'contributors()' for more information and 317s 'citation()' on how to cite R or R packages in publications. 317s 317s Type 'demo()' for some demos, 'help()' for on-line help, or 317s 'help.start()' for an HTML browser interface to help. 317s Type 'q()' to quit R. 317s 317s > ## git2r, R bindings to the libgit2 library. 317s > ## Copyright (C) 2013-2023 The git2r contributors 317s > ## 317s > ## This program is free software; you can redistribute it and/or modify 317s > ## it under the terms of the GNU General Public License, version 2, 317s > ## as published by the Free Software Foundation. 317s > ## 317s > ## git2r is distributed in the hope that it will be useful, 317s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 317s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 317s > ## GNU General Public License for more details. 317s > ## 317s > ## You should have received a copy of the GNU General Public License along 317s > ## with this program; if not, write to the Free Software Foundation, Inc., 317s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 317s > 317s > library(git2r) 317s > source("util/check.R") 317s > 317s > ## For debugging 317s > sessionInfo() 317s R version 4.4.3 (2025-02-28) 317s Platform: aarch64-unknown-linux-gnu 317s Running under: Ubuntu Plucky Puffin (development branch) 317s 317s Matrix products: default 317s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 317s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 317s 317s locale: 317s [1] C 317s 317s time zone: Etc/UTC 317s tzcode source: system (glibc) 317s 317s attached base packages: 317s [1] stats graphics grDevices utils datasets methods base 317s 317s other attached packages: 317s [1] git2r_0.35.0 317s 317s loaded via a namespace (and not attached): 317s [1] compiler_4.4.3 317s > libgit2_version() 317s $major 317s [1] 1 317s 317s $minor 317s [1] 9 317s 317s $rev 317s [1] 0 317s 317s > libgit2_features() 317s $threads 317s [1] TRUE 317s 317s $https 317s [1] TRUE 317s 317s $ssh 317s [1] TRUE 317s 317s > 317s > 317s > ## Create a directory in tempdir 317s > path <- tempfile(pattern = "git2r-") 317s > dir.create(path) 317s > 317s > ## Initialize a repository 317s > repo <- init(path) 317s > config(repo, user.name = "Alice", user.email = "alice@example.org") 317s > 317s > ## Commit without adding changes should produce an error 317s > tools::assertError(commit(repo, "Test to commit")) 317s > 317s > ## Create a file 317s > writeLines("Hello world!", file.path(path, "test.txt")) 317s > 317s > ## Commit without adding changes should produce an error 317s > tools::assertError(commit(repo, "Test to commit")) 317s > 317s > ## Add 317s > add(repo, "test.txt") 317s > 317s > ## Commit with empty message should produce an error 317s > tools::assertError(commit(repo, "")) 317s > 317s > ## Commit 317s > commit_1 <- commit(repo, "Commit message", session = TRUE) 317s > summary(commit_1) 317s Commit: e713902180c6679733095dde08b24c6ea7b08d02 317s Author: Alice 317s When: 2025-03-15 14:47:37 GMT 317s 317s Commit message 317s 317s sessionInfo: 317s R version 4.4.3 (2025-02-28) 317s Platform: aarch64-unknown-linux-gnu 317s Running under: Ubuntu Plucky Puffin (development branch) 317s 317s Matrix products: default 317s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 317s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 317s 317s locale: 317s [1] C 317s 317s time zone: Etc/UTC 317s tzcode source: system (glibc) 317s 317s attached base packages: 317s [1] stats graphics grDevices utils datasets methods base 317s 317s other attached packages: 317s [1] git2r_0.35.0 317s 317s loaded via a namespace (and not attached): 317s [1] compiler_4.4.3 tools_4.4.3 317s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 317s > 317s > ## Check commit 317s > stopifnot(identical(commit_1$author$name, "Alice")) 317s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 317s > stopifnot(identical(lookup(repo, sha(commit_1)), commit_1)) 317s > stopifnot(identical(length(commits(repo)), 1L)) 317s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 317s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 317s > stopifnot(identical(parents(commit_1), list())) 317s > stopifnot(identical(print(commit_1), commit_1)) 317s [e713902] 2025-03-15: Commit message 317s > 317s > ## Check is_commit 317s > stopifnot(identical(is_commit(commit_1), TRUE)) 317s > stopifnot(identical(is_commit(5), FALSE)) 317s > 317s > ## Commit without adding changes should produce an error 317s > tools::assertError(commit(repo, "Test to commit")) 317s > 317s > ## Add another commit 317s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 317s > add(repo, "test.txt") 317s > commit_2 <- commit(repo, "Commit message 2") 317s > summary(commit_2) 317s Commit: 40757708703c444430be7ae917e18e0ade08e69c 317s Author: Alice 317s When: 2025-03-15 14:47:37 GMT 317s 317s Commit message 2 317s 1 file changed, 1 insertions, 0 deletions 317s test.txt | -0 +1 in 1 hunk 317s 317s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 317s > 317s > ## Check relationship 317s > stopifnot(identical(descendant_of(commit_2, commit_1), TRUE)) 317s > stopifnot(identical(descendant_of(commit_1, commit_2), FALSE)) 317s > stopifnot(identical(descendant_of(tag_2, tag_1), TRUE)) 317s > stopifnot(identical(descendant_of(tag_1, tag_2), FALSE)) 317s > stopifnot(identical(descendant_of(branches(repo)[[1]], commit_1), TRUE)) 317s > stopifnot(identical(descendant_of(commit_1, branches(repo)[[1]]), FALSE)) 317s > stopifnot(identical(length(parents(commit_2)), 1L)) 317s > stopifnot(identical(parents(commit_2)[[1]], commit_1)) 317s > 317s > ## Check contributions 317s > stopifnot(identical( 317s + colnames(contributions(repo, by = "author", breaks = "day")), 317s + c("when", "author", "n"))) 317s > stopifnot(identical(colnames(contributions(repo)), 317s + c("when", "n"))) 317s > stopifnot(identical(nrow(contributions(repo)), 1L)) 317s > stopifnot(identical(contributions(repo)$n, 2L)) 317s > stopifnot(identical(contributions(repo, by = "author", breaks = "day")$n, 2L)) 317s > 317s > ## Add another commit with 'all' argument 317s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 317s + file.path(path, "test.txt")) 317s > commit(repo, "Commit message 3", all = TRUE) 317s [1edee9c] 2025-03-15: Commit message 3 317s > 317s > status_clean <- structure(list(staged = empty_named_list(), 317s + unstaged = empty_named_list(), 317s + untracked = empty_named_list()), 317s + class = "git_status") 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > ## Delete file and commit with 'all' argument 317s > file.remove(file.path(path, "test.txt")) 317s [1] TRUE 317s > commit(repo, "Commit message 4", all = TRUE) 317s [5d26070] 2025-03-15: Commit message 4 317s > 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > ## Add and commit multiple tracked files with 'all' argument 317s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 317s > add(repo, "test2.txt") 317s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 317s > add(repo, "test3.txt") 317s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 317s > add(repo, "test4.txt") 317s > commit(repo, "Commit message 5") 317s [2b161cb] 2025-03-15: Commit message 5 317s > 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 317s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 317s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 317s > commit(repo, "Commit message 6", all = TRUE) 317s [48a4ac7] 2025-03-15: Commit message 6 317s > 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > ## Add one tracked file and delete another with 'all' argument 317s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 317s > file.remove(file.path(path, "test4.txt")) 317s [1] TRUE 317s > commit(repo, "Commit message 7", all = TRUE) 317s [f76a0fe] 2025-03-15: Commit message 7 317s > 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > ## Delete multiple tracked files with 'all' argument 317s > file.remove(file.path(path, "test2.txt")) 317s [1] TRUE 317s > file.remove(file.path(path, "test3.txt")) 317s [1] TRUE 317s > commit(repo, "Commit message 8", all = TRUE) 317s [0f584ad] 2025-03-15: Commit message 8 317s > 317s > stopifnot(identical(status(repo), status_clean)) 317s > 317s > ## Check max number of commits in output 317s > stopifnot(identical(length(commits(repo)), 8L)) 317s > stopifnot(identical(length(commits(repo, n = -1)), 8L)) 317s > stopifnot(identical(length(commits(repo, n = 2)), 2L)) 317s > tools::assertError(commits(repo, n = 2.2)) 317s > tools::assertError(commits(repo, n = "2")) 317s > tools::assertError(commits(repo, n = 1:2)) 317s > 317s > ## Check to coerce repository to data.frame 317s > df <- as.data.frame(repo) 317s > stopifnot(identical(dim(df), c(8L, 6L))) 317s > stopifnot(identical(names(df), c("sha", "summary", "message", 317s + "author", "email", "when"))) 317s > 317s > ## Set working directory to path and check commits 317s > setwd(path) 317s > stopifnot(identical(sha(last_commit()), sha(commits(repo, n = 1)[[1]]))) 317s > stopifnot(identical(length(commits()), 8L)) 317s > stopifnot(identical(length(commits(n = -1)), 8L)) 317s > stopifnot(identical(length(commits(n = 2)), 2L)) 317s > tools::assertError(commits(n = 2.2)) 317s > tools::assertError(commits(n = "2")) 317s > 317s > ## Check plot method 317s > plot_file <- tempfile(fileext = ".pdf") 317s > pdf(plot_file) 317s > plot(repo) 317s > dev.off() 317s null device 317s 1 317s > stopifnot(file.exists(plot_file)) 317s > unlink(plot_file) 317s > 317s > ## Check punch card plot method 317s > punch_card_plot_file <- tempfile(fileext = ".pdf") 317s > pdf(punch_card_plot_file) 317s > punch_card(repo) 317s > dev.off() 317s null device 317s 1 317s > stopifnot(file.exists(punch_card_plot_file)) 317s > unlink(punch_card_plot_file) 317s > 317s > ## Check that 'git2r_arg_check_commit' raise error 317s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, NULL)) 317s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 317s + res[[1]]$message)) > 0) 317s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, 3)) 317s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 317s + res[[1]]$message)) > 0) 317s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, repo)) 317s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 317s + res[[1]]$message)) > 0) 317s > commit_1$sha <- NA_character_ 317s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, commit_1)) 317s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 317s + res[[1]]$message)) > 0) 317s > 317s > ## Cleanup 317s > unlink(path, recursive = TRUE) 317s > 317s > if (identical(Sys.getenv("NOT_CRAN"), "true") || 317s + identical(Sys.getenv("R_COVR"), "true")) { 317s + path <- tempfile(pattern = "git2r-") 317s + dir.create(path) 317s + setwd(path) 317s + system("git clone --depth 2 https://github.com/ropensci/git2r.git") 317s + 317s + ## Check the number of commits in the shallow clone. 317s + stopifnot(identical(length(commits(repository("git2r"))), 2L)) 317s + stopifnot(identical(length(commits(repository("git2r"), n = 1)), 1L)) 317s + 317s + ## Cleanup 317s + unlink(path, recursive = TRUE) 317s + } 317s > 317s sh: 0: getcwd() failed: No such file or directory 317s BEGIN TEST commits_path.R 317s 317s R version 4.4.3 (2025-02-28) -- "Trophy Case" 317s Copyright (C) 2025 The R Foundation for Statistical Computing 317s Platform: aarch64-unknown-linux-gnu 317s 317s R is free software and comes with ABSOLUTELY NO WARRANTY. 317s You are welcome to redistribute it under certain conditions. 317s Type 'license()' or 'licence()' for distribution details. 317s 317s R is a collaborative project with many contributors. 317s Type 'contributors()' for more information and 317s 'citation()' on how to cite R or R packages in publications. 317s 317s Type 'demo()' for some demos, 'help()' for on-line help, or 317s 'help.start()' for an HTML browser interface to help. 317s Type 'q()' to quit R. 317s 318s > ## git2r, R bindings to the libgit2 library. 318s > ## Copyright (C) 2013-2023 The git2r contributors 318s > ## 318s > ## This program is free software; you can redistribute it and/or modify 318s > ## it under the terms of the GNU General Public License, version 2, 318s > ## as published by the Free Software Foundation. 318s > ## 318s > ## git2r is distributed in the hope that it will be useful, 318s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 318s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 318s > ## GNU General Public License for more details. 318s > ## 318s > ## You should have received a copy of the GNU General Public License along 318s > ## with this program; if not, write to the Free Software Foundation, Inc., 318s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 318s > 318s > library(git2r) 318s > 318s > ## For debugging 318s > sessionInfo() 318s R version 4.4.3 (2025-02-28) 318s Platform: aarch64-unknown-linux-gnu 318s Running under: Ubuntu Plucky Puffin (development branch) 318s 318s Matrix products: default 318s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 318s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 318s 318s locale: 318s [1] C 318s 318s time zone: Etc/UTC 318s tzcode source: system (glibc) 318s 318s attached base packages: 318s [1] stats graphics grDevices utils datasets methods base 318s 318s other attached packages: 318s [1] git2r_0.35.0 318s 318s loaded via a namespace (and not attached): 318s [1] compiler_4.4.3 318s > libgit2_version() 318s $major 318s [1] 1 318s 318s $minor 318s [1] 9 318s 318s $rev 318s [1] 0 318s 318s > libgit2_features() 318s $threads 318s [1] TRUE 318s 318s $https 318s [1] TRUE 318s 318s $ssh 318s [1] TRUE 318s 318s > 318s > 318s > ## Create a directory in tempdir 318s > path <- tempfile(pattern = "git2r-") 318s > dir.create(path) 318s > 318s > ## Initialize a repository 318s > repo <- init(path, branch = "main") 318s > config(repo, user.name = "Alice", user.email = "alice@example.org") 318s > 318s > ## Create two files and alternate commits 318s > writeLines("1", file.path(path, "odd.txt")) 318s > add(repo, "odd.txt") 318s > c1 <- commit(repo, "commit 1") 318s > 318s > writeLines("2", file.path(path, "even.txt")) 318s > add(repo, "even.txt") 318s > c2 <- commit(repo, "commit 2") 318s > 318s > writeLines("3", file.path(path, "odd.txt")) 318s > add(repo, "odd.txt") 318s > c3 <- commit(repo, "commit 3") 318s > 318s > writeLines("4", file.path(path, "even.txt")) 318s > add(repo, "even.txt") 318s > c4 <- commit(repo, "commit 4") 318s > 318s > writeLines("5", file.path(path, "odd.txt")) 318s > add(repo, "odd.txt") 318s > c5 <- commit(repo, "commit 5") 318s > 318s > writeLines("6", file.path(path, "even.txt")) 318s > add(repo, "even.txt") 318s > c6 <- commit(repo, "commit 6") 318s > 318s > commits_all <- commits(repo) 318s > stopifnot(length(commits_all) == 6) 318s > 318s > ## Test path 318s > commits_odd <- commits(repo, path = "odd.txt") 318s > stopifnot(length(commits_odd) == 3) 318s > stopifnot(commits_odd[[1]]$sha == c5$sha) 318s > stopifnot(commits_odd[[2]]$sha == c3$sha) 318s > stopifnot(commits_odd[[3]]$sha == c1$sha) 318s > 318s > commits_even <- commits(repo, path = "even.txt") 318s > stopifnot(length(commits_even) == 3) 318s > stopifnot(commits_even[[1]]$sha == c6$sha) 318s > stopifnot(commits_even[[2]]$sha == c4$sha) 318s > stopifnot(commits_even[[3]]$sha == c2$sha) 318s > 318s > ## Test reverse 318s > commits_odd_rev <- commits(repo, reverse = TRUE, path = "odd.txt") 318s > stopifnot(length(commits_odd_rev) == 3) 318s > stopifnot(commits_odd_rev[[1]]$sha == c1$sha) 318s > stopifnot(commits_odd_rev[[2]]$sha == c3$sha) 318s > stopifnot(commits_odd_rev[[3]]$sha == c5$sha) 318s > 318s > commits_even_rev <- commits(repo, reverse = TRUE, path = "even.txt") 318s > stopifnot(length(commits_even_rev) == 3) 318s > stopifnot(commits_even_rev[[1]]$sha == c2$sha) 318s > stopifnot(commits_even_rev[[2]]$sha == c4$sha) 318s > stopifnot(commits_even_rev[[3]]$sha == c6$sha) 318s > 318s > ## Test n 318s > commits_odd_n <- commits(repo, n = 2, path = "odd.txt") 318s > stopifnot(length(commits_odd_n) == 2) 318s > stopifnot(commits_odd_n[[1]]$sha == c5$sha) 318s > stopifnot(commits_odd_n[[2]]$sha == c3$sha) 318s > 318s > commits_even_n <- commits(repo, n = 2, path = "even.txt") 318s > stopifnot(length(commits_even_n) == 2) 318s > stopifnot(commits_even_n[[1]]$sha == c6$sha) 318s > stopifnot(commits_even_n[[2]]$sha == c4$sha) 318s > 318s > commits_odd_0 <- commits(repo, n = 0, path = "odd.txt") 318s > stopifnot(length(commits_odd_0) == 0) 318s > stopifnot(identical(commits_odd_0, list())) 318s > 318s > commits_even_0 <- commits(repo, n = 0, path = "even.txt") 318s > stopifnot(length(commits_even_0) == 0) 318s > stopifnot(identical(commits_even_0, list())) 318s > 318s > ## Test ref 318s > checkout(repo, branch = "test-ref", create = TRUE) 318s > 318s > writeLines("7", file.path(path, "odd.txt")) 318s > add(repo, "odd.txt") 318s > c7 <- commit(repo, "commit 7") 318s > 318s > writeLines("8", file.path(path, "even.txt")) 318s > add(repo, "even.txt") 318s > c8 <- commit(repo, "commit 8") 318s > 318s > commits_odd_ref <- commits(repo, ref = "main", path = "odd.txt") 318s > stopifnot(length(commits_odd_ref) == 3) 318s > stopifnot(commits_odd_ref[[1]]$sha == c5$sha) 318s > stopifnot(commits_odd_ref[[2]]$sha == c3$sha) 318s > stopifnot(commits_odd_ref[[3]]$sha == c1$sha) 318s > 318s > commits_even_ref <- commits(repo, ref = "main", path = "even.txt") 318s > stopifnot(length(commits_even_ref) == 3) 318s > stopifnot(commits_even_ref[[1]]$sha == c6$sha) 318s > stopifnot(commits_even_ref[[2]]$sha == c4$sha) 318s > stopifnot(commits_even_ref[[3]]$sha == c2$sha) 318s > 318s > checkout(repo, branch = "main") 318s > 318s > ## Test renaming a file (path does not support --follow) 318s > writeLines("a file to be renamed", file.path(path, "original.txt")) 318s > add(repo, "original.txt") 318s > c_original <- commit(repo, "commit original") 318s > 318s > commits_original <- commits(repo, path = "original.txt") 318s > stopifnot(length(commits_original) == 1) 318s > stopifnot(commits_original[[1]]$sha == c_original$sha) 318s > 318s > file.rename(file.path(path, "original.txt"), file.path(path, "new.txt")) 318s [1] TRUE 318s > add(repo, c("original.txt", "new.txt")) 318s > c_new <- commit(repo, "commit new") 318s > 318s > commits_new <- commits(repo, path = "new.txt") 318s > stopifnot(length(commits_new) == 1) 318s > stopifnot(commits_new[[1]]$sha == c_new$sha) 318s > 318s > ## Test merge commits 318s > writeLines(letters[1:5], file.path(path, "merge.txt")) 318s > add(repo, "merge.txt") 318s > c_merge_1 <- commit(repo, "commit merge 1") 318s > 318s > checkout(repo, branch = "test-merge", create = TRUE) 318s > cat("z", file = file.path(path, "merge.txt"), append = TRUE) 318s > add(repo, "merge.txt") 318s > c_merge_2 <- commit(repo, "commit merge 2") 318s > 318s > checkout(repo, branch = "main") 318s > writeLines(c("A", letters[2:5]), file.path(path, "merge.txt")) 318s > add(repo, "merge.txt") 318s > c_merge_3 <- commit(repo, "commit merge 3") 318s > 318s > c_merge_4 <- merge(repo, "test-merge") 318s > stopifnot(class(c_merge_4) == "git_merge_result") 318s > 318s > commits_merge <- commits(repo, path = "merge.txt") 318s > stopifnot(length(commits_merge) == 4) 318s > stopifnot(commits_merge[[1]]$sha == c_merge_4$sha) 318s > stopifnot(commits_merge[[2]]$sha == c_merge_3$sha) 318s > stopifnot(commits_merge[[3]]$sha == c_merge_2$sha) 318s > stopifnot(commits_merge[[4]]$sha == c_merge_1$sha) 318s > 318s > ## Test absolute path 318s > writeLines("absolute", file.path(path, "abs.txt")) 318s > add(repo, "abs.txt") 318s > c_abs <- commit(repo, "commit absolute") 318s > 318s > commits_abs <- commits(repo, path = file.path(path, "abs.txt")) 318s > stopifnot(length(commits_abs) == 1) 318s > stopifnot(commits_abs[[1]]$sha == c_abs$sha) 318s > 318s > ## Test topological and time 318s > ## Strategy: 318s > ## - Commit a new file test-time.txt 318s > ## - Commit a change on branch test-time-1 (a) 318s > ## - Commit a change on branch test-time-2 (c) 318s > ## - Commit a change on branch test-time-1 (b) 318s > ## - Commit a change on branch test-time-2 (d) 318s > ## - Merge branch test-time-2 into main (fast-forward) 318s > ## - Merge branch test-time-1 into main (merge commit) 318s > ## 318s > ## $ git log --all --decorate --oneline --graph -n 6 318s > ## * 79e6880 (HEAD -> main) merge test-time-1 318s > ## |\ 318s > ## | * e2f18f1 (test-time-1) commit b 318s > ## | * 5f34820 commit a 318s > ## * | b954ec9 (test-time-2) commit d 318s > ## * | 7ae2fd5 commit c 318s > ## |/ 318s > ## * 923f3ea commit base 318s > Sys.sleep(1) 319s > writeLines(as.character(1:100), file.path(path, "test-time.txt")) 319s > add(repo, "test-time.txt") 319s > c_base <- commit(repo, "commit base") 319s > Sys.sleep(1) 320s > branch_create(commit = c_base, name = "test-time-1") 320s > branch_create(commit = c_base, name = "test-time-2") 320s > 320s > checkout(repo, branch = "test-time-1") 320s > writeLines(c("edit", 2:100), file.path(path, "test-time.txt")) 320s > add(repo, "test-time.txt") 320s > c_a <- commit(repo, "commit a") 320s > Sys.sleep(1) 321s > 321s > checkout(repo, branch = "test-time-2") 321s > writeLines(c(1:25, "edit", 27:100), file.path(path, "test-time.txt")) 321s > add(repo, "test-time.txt") 321s > c_c <- commit(repo, "commit c") 321s > Sys.sleep(1) 322s > 322s > checkout(repo, branch = "test-time-1") 322s > writeLines(c(1:50, "edit", 52:100), file.path(path, "test-time.txt")) 322s > add(repo, "test-time.txt") 322s > c_b <- commit(repo, "commit b") 322s > Sys.sleep(1) 323s > 323s > checkout(repo, branch = "test-time-2") 323s > writeLines(c(1:75, "edit", 77:100), file.path(path, "test-time.txt")) 323s > add(repo, "test-time.txt") 323s > c_d <- commit(repo, "commit d") 323s > Sys.sleep(1) 324s > 324s > checkout(repo, branch = "main") 324s > merge(repo, "test-time-2") # Fast-forward 324s Merge: Fast-forward 324s > merge(repo, "test-time-1") # Merge commit 324s Merge 324s > c_merge_time <- commits(repo, n = 1)[[1]] 324s > 324s > ## topological - commits in test-time-2 come first because it was 324s > ## merged first 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 324s + list(c_merge_time, c_b, c_a, c_d, c_c, c_base) 324s + )) 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 324s + commits(repo, topological = TRUE, time = FALSE)[1:6] 324s + )) 324s > 324s > ## time - commits ordered by time they were created, not merged into 324s > ## main 324s > stopifnot(identical( 324s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 324s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 324s + )) 324s > stopifnot(identical( 324s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 324s + commits(repo, topological = FALSE, time = TRUE)[1:6] 324s + )) 324s > 324s > ## topological and time - dominated by time 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 324s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 324s + )) 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 324s + commits(repo, topological = TRUE, time = TRUE)[1:6] 324s + )) 324s > 324s > ## reverse with topological and/or time 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = FALSE, reverse = TRUE, 324s + path = "test-time.txt"), 324s + rev(list(c_merge_time, c_b, c_a, c_d, c_c, c_base)) 324s + )) 324s > stopifnot(identical( 324s + commits(repo, topological = FALSE, time = TRUE, reverse = TRUE, 324s + path = "test-time.txt"), 324s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 324s + )) 324s > stopifnot(identical( 324s + commits(repo, topological = TRUE, time = TRUE, reverse = TRUE, 324s + path = "test-time.txt"), 324s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 324s + )) 324s > 324s > ## Cleanup 324s > unlink(path, recursive = TRUE) 324s > 324s BEGIN TEST config.R 324s 324s R version 4.4.3 (2025-02-28) -- "Trophy Case" 324s Copyright (C) 2025 The R Foundation for Statistical Computing 324s Platform: aarch64-unknown-linux-gnu 324s 324s R is free software and comes with ABSOLUTELY NO WARRANTY. 324s You are welcome to redistribute it under certain conditions. 324s Type 'license()' or 'licence()' for distribution details. 324s 324s R is a collaborative project with many contributors. 324s Type 'contributors()' for more information and 324s 'citation()' on how to cite R or R packages in publications. 324s 324s Type 'demo()' for some demos, 'help()' for on-line help, or 324s 'help.start()' for an HTML browser interface to help. 324s Type 'q()' to quit R. 324s 324s > ## git2r, R bindings to the libgit2 library. 324s > ## Copyright (C) 2013-2023 The git2r contributors 324s > ## 324s > ## This program is free software; you can redistribute it and/or modify 324s > ## it under the terms of the GNU General Public License, version 2, 324s > ## as published by the Free Software Foundation. 324s > ## 324s > ## git2r is distributed in the hope that it will be useful, 324s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 324s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 324s > ## GNU General Public License for more details. 324s > ## 324s > ## You should have received a copy of the GNU General Public License along 324s > ## with this program; if not, write to the Free Software Foundation, Inc., 324s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 324s > 324s > library("git2r") 324s > 324s > ## For debugging 324s > sessionInfo() 324s R version 4.4.3 (2025-02-28) 324s Platform: aarch64-unknown-linux-gnu 324s Running under: Ubuntu Plucky Puffin (development branch) 324s 324s Matrix products: default 324s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 324s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 324s 324s locale: 324s [1] C 324s 324s time zone: Etc/UTC 324s tzcode source: system (glibc) 324s 324s attached base packages: 324s [1] stats graphics grDevices utils datasets methods base 324s 324s other attached packages: 324s [1] git2r_0.35.0 324s 324s loaded via a namespace (and not attached): 324s [1] compiler_4.4.3 324s > libgit2_version() 324s $major 324s [1] 1 324s 324s $minor 324s [1] 9 324s 324s $rev 324s [1] 0 324s 324s > libgit2_features() 324s $threads 324s [1] TRUE 324s 324s $https 324s [1] TRUE 324s 324s $ssh 324s [1] TRUE 324s 324s > 324s > 324s > ## Create a directory in tempdir 324s > path <- tempfile(pattern = "git2r-") 324s > dir.create(path) 324s > 324s > ## Initialize a repository 324s > repo <- init(path) 324s > 324s > ## Config repository 324s > cfg <- config(repo, user.name = "Alice", user.email = "alice@example.org") 324s > 324s > ## Check configuration 324s > stopifnot(identical(print(cfg), cfg)) 324s local: 324s core.bare=false 324s core.filemode=true 324s core.logallrefupdates=true 324s core.repositoryformatversion=0 324s user.email=alice@example.org 324s user.name=Alice 324s > stopifnot("local" %in% names(cfg)) 324s > stopifnot("user.name" %in% names(cfg$local)) 324s > stopifnot(identical(cfg$local$user.name, "Alice")) 324s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 324s > 324s > ## Check that config fails for non-character entry. 324s > tools::assertError(config(repo, test = 5)) 324s > 324s > ## Check config method with missing repo argument 324s > wd <- setwd(path) 324s > cfg <- config(user.name = "Alice", user.email = "alice@example.org") 324s > stopifnot("local" %in% names(cfg)) 324s > stopifnot("user.name" %in% names(cfg$local)) 324s > stopifnot(identical(cfg$local$user.name, "Alice")) 324s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 324s > stopifnot(identical(git_config_files(repo = repo)$local, 324s + git_config_files(repo = NULL)$local)) 324s > stopifnot(identical(git_config_files(repo = repo)$local, 324s + git_config_files(repo = repo$path)$local)) 324s > if (!is.null(wd)) 324s + setwd(wd) 324s > 324s > ## Delete entries 324s > cfg <- config(repo, user.name = NULL, user.email = NULL) 324s > 324s > ## Check configuration 324s > stopifnot(is.null(cfg$local$user.name)) 324s > stopifnot(is.null(cfg$local$user.email)) 324s > 324s > ## Supply values as objects 324s > user_name <- "Alice" 324s > user_email <- "alice@example.org" 324s > cfg <- config(repo, user.name = user_name, user.email = "alice@example.org") 324s > stopifnot(identical(cfg$local$user.name, user_name)) 324s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 324s > cfg <- config(repo, user.name = "Alice", user.email = user_email) 324s > stopifnot(identical(cfg$local$user.name, "Alice")) 324s > stopifnot(identical(cfg$local$user.email, user_email)) 324s > 324s > ## Check git config files 324s > cfg <- git_config_files(repo) 324s > stopifnot(identical(nrow(cfg), 4L)) 324s > stopifnot(identical(names(cfg), c("file", "path"))) 324s > stopifnot(identical(cfg$file, c("system", "xdg", "global", "local"))) 324s > stopifnot(!is.na(cfg$path[4])) 324s > 324s > ## Check that the local config file is NA for an invalid repo 324s > ## argument. 324s > stopifnot(is.na(git_config_files(5)$local)) 324s > 324s > ## Check location of .gitconfig on Windows 324s > if (identical(Sys.getenv("APPVEYOR"), "True")) { 324s + 324s + ## AppVeyor diagnostics 324s + str(Sys.getenv("USERPROFILE")) 324s + str(Sys.getenv("HOMEDRIVE")) 324s + str(normalizePath("~")) 324s + str(git_config_files()) 324s + 324s + ## Temporarily move AppVeyor .gitconfig 324s + gitconfig_appveyor <- "C:/Users/appveyor/.gitconfig" 324s + gitconfig_tmp <- file.path(tempdir(), ".gitconfig") 324s + file.rename(gitconfig_appveyor, gitconfig_tmp) 324s + 324s + ## Test config() on Windows 324s + gitconfig_expected <- file.path(Sys.getenv("USERPROFILE"), ".gitconfig") 324s + ## .gitconfig should not be created if no configuration options specified 324s + config(global = TRUE) 324s + stopifnot(!file.exists(gitconfig_expected)) 324s + ## .gitconfig should be created in the user's home directory 324s + config(global = TRUE, user.name = "name", user.email = "email") 324s + stopifnot(file.exists(gitconfig_expected)) 324s + unlink(gitconfig_expected) 324s + ## .gitconfig should be created if user specifies option other than user.name 324s + ## and user.email 324s + config(global = TRUE, core.editor = "nano") 324s + stopifnot(file.exists(gitconfig_expected)) 324s + unlink(gitconfig_expected) 324s + ## .gitconfig should not create a new .gitconfig if the user already has one 324s + ## in Documents/ 324s + gitconfig_documents <- "~/.gitconfig" 324s + file.create(gitconfig_documents) 324s + config(global = TRUE, core.editor = "nano") 324s + stopifnot(!file.exists(gitconfig_expected)) 324s + unlink(gitconfig_documents) 324s + 324s + ## Return AppVeyor .gitconfig 324s + file.rename(gitconfig_tmp, gitconfig_appveyor) 324s + } 324s > 324s > ## Cleanup 324s > unlink(path, recursive = TRUE) 324s > 324s BEGIN TEST diff.R 324s 324s R version 4.4.3 (2025-02-28) -- "Trophy Case" 324s Copyright (C) 2025 The R Foundation for Statistical Computing 324s Platform: aarch64-unknown-linux-gnu 324s 324s R is free software and comes with ABSOLUTELY NO WARRANTY. 324s You are welcome to redistribute it under certain conditions. 324s Type 'license()' or 'licence()' for distribution details. 324s 324s R is a collaborative project with many contributors. 324s Type 'contributors()' for more information and 324s 'citation()' on how to cite R or R packages in publications. 324s 324s Type 'demo()' for some demos, 'help()' for on-line help, or 324s 'help.start()' for an HTML browser interface to help. 324s Type 'q()' to quit R. 324s 324s > ## git2r, R bindings to the libgit2 library. 324s > ## Copyright (C) 2013-2023 The git2r contributors 324s > ## 324s > ## This program is free software; you can redistribute it and/or modify 324s > ## it under the terms of the GNU General Public License, version 2, 324s > ## as published by the Free Software Foundation. 324s > ## 324s > ## git2r is distributed in the hope that it will be useful, 324s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 324s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 324s > ## GNU General Public License for more details. 324s > ## 324s > ## You should have received a copy of the GNU General Public License along 324s > ## with this program; if not, write to the Free Software Foundation, Inc., 324s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 324s > 324s > library("git2r") 324s > 324s > ## For debugging 324s > sessionInfo() 324s R version 4.4.3 (2025-02-28) 324s Platform: aarch64-unknown-linux-gnu 324s Running under: Ubuntu Plucky Puffin (development branch) 324s 324s Matrix products: default 324s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 324s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 324s 324s locale: 324s [1] C 324s 324s time zone: Etc/UTC 324s tzcode source: system (glibc) 324s 324s attached base packages: 324s [1] stats graphics grDevices utils datasets methods base 324s 324s other attached packages: 324s [1] git2r_0.35.0 324s 324s loaded via a namespace (and not attached): 324s [1] compiler_4.4.3 324s > libgit2_version() 324s $major 324s [1] 1 324s 324s $minor 324s [1] 9 324s 324s $rev 324s [1] 0 324s 324s > libgit2_features() 324s $threads 324s [1] TRUE 324s 324s $https 324s [1] TRUE 324s 324s $ssh 324s [1] TRUE 324s 324s > 324s > 324s > ## Create a directory in tempdir 324s > path <- tempfile(pattern = "git2r-") 324s > dir.create(path) 324s > 324s > ## Initialize a repository 324s > repo <- init(path) 324s > config(repo, user.name = "Alice", user.email = "alice@example.org") 324s > 324s > ## Create a file, add, commit 324s > writeLines("Hello world!", file.path(path, "test.txt")) 324s > add(repo, "test.txt") 324s > commit(repo, "Commit message") 324s [1246279] 2025-03-15: Commit message 324s > 324s > ## Change the file, diff between index and workdir 324s > writeLines("Hello again!\nHere is a second line\nAnd a third", 324s + file.path(path, "test.txt")) 324s > diff_1 <- diff(repo) 324s > diff(repo, as_char = TRUE) 324s [1] "diff --git a/test.txt b/test.txt\nindex cd08755..cf48daf 100644\n--- a/test.txt\n+++ b/test.txt\n@@ -1 +1,3 @@\n-Hello world!\n+Hello again!\n+Here is a second line\n+And a third\n" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_1$old, "index")) 324s > stopifnot(identical(diff_1$new, "workdir")) 324s > stopifnot(identical(length(diff_1$files), 1L)) 324s > stopifnot(identical(diff_1$files[[1]]$old_file, "test.txt")) 324s > stopifnot(identical(diff_1$files[[1]]$new_file, "test.txt")) 324s > stopifnot(identical(length(diff_1$files[[1]]$hunks), 1L)) 324s > stopifnot(identical(length(diff_1$files[[1]]$hunks[[1]]$lines), 4L)) 324s > ## TODO: check actual diff 324s > 324s > ## Diff between index and HEAD is empty 324s > diff_2 <- diff(repo, index = TRUE) 324s > diff(repo, as_char = TRUE) 324s [1] "diff --git a/test.txt b/test.txt\nindex cd08755..cf48daf 100644\n--- a/test.txt\n+++ b/test.txt\n@@ -1 +1,3 @@\n-Hello world!\n+Hello again!\n+Here is a second line\n+And a third\n" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_2$old, "HEAD")) 324s > stopifnot(identical(diff_2$new, "index")) 324s > stopifnot(identical(diff_2$files, list())) 324s > 324s > ## Diff between tree and working dir, same as diff_1 324s > diff_3 <- diff(tree(commits(repo)[[1]])) 324s > diff(repo, as_char = TRUE) 324s [1] "diff --git a/test.txt b/test.txt\nindex cd08755..cf48daf 100644\n--- a/test.txt\n+++ b/test.txt\n@@ -1 +1,3 @@\n-Hello world!\n+Hello again!\n+Here is a second line\n+And a third\n" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_3$old, tree(commits(repo)[[1]]))) 324s > stopifnot(identical(diff_3$new, "workdir")) 324s > stopifnot(identical(diff_3$files, diff_1$files)) 324s > stopifnot(identical(print(diff_3), diff_3)) 324s Old: tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 324s 324s mode type sha name 324s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 324s New: workdir 324s > 324s > ## Add changes, diff between index and HEAD is the same as diff_1 324s > add(repo, "test.txt") 324s > diff_4 <- diff(repo, index = TRUE) 324s > diff(repo, as_char = TRUE) 324s [1] "" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_4$old, "HEAD")) 324s > stopifnot(identical(diff_4$new, "index")) 324s > stopifnot(identical(diff_4$files, diff_1$files)) 324s > 324s > ## Diff between tree and index 324s > diff_5 <- diff(tree(commits(repo)[[1]]), index = TRUE) 324s > diff(repo, as_char = TRUE) 324s [1] "" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_5$old, tree(commits(repo)[[1]]))) 324s > stopifnot(identical(diff_5$new, "index")) 324s > stopifnot(identical(diff_5$files, diff_1$files)) 324s > 324s > ## Diff between two trees 324s > commit(repo, "Second commit") 324s [f402263] 2025-03-15: Second commit 324s > tree_1 <- tree(commits(repo)[[2]]) 324s > tree_2 <- tree(commits(repo)[[1]]) 324s > diff_6 <- diff(tree_1, tree_2) 324s > diff(repo, as_char = TRUE) 324s [1] "" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(identical(diff_6$old, tree_1)) 324s > stopifnot(identical(diff_6$new, tree_2)) 324s > stopifnot(identical(diff_6$files, diff_1$files)) 324s > 324s > ## Length of a diff 324s > stopifnot(identical(length(diff_1), 1L)) 324s > stopifnot(identical(length(diff_2), 0L)) 324s > stopifnot(identical(length(diff_3), 1L)) 324s > stopifnot(identical(length(diff_4), 1L)) 324s > stopifnot(identical(length(diff_5), 1L)) 324s > stopifnot(identical(length(diff_6), 1L)) 324s > 324s > ## Binary files 324s > set.seed(42) 324s > writeBin(as.raw((sample(0:255, 1000, replace = TRUE))), 324s + con = file.path(path, "test.bin")) 324s > add(repo, "test.bin") 324s > diff_7 <- diff(repo, index = TRUE) 324s > diff(repo, as_char = TRUE) 324s [1] "" 324s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 324s NULL 324s > 324s > stopifnot(any(grepl("binary file", capture.output(summary(diff_7))))) 324s > 324s > ## TODO: errors 324s > ## Check non-logical index argument 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, NULL, NULL, NULL, "FALSE", 324s + NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep(paste0("Error in 'git2r_diff': 'index' must be logical ", 324s + "vector of length one with non NA value\n"), 324s + res[[1]]$message)) > 0) 324s > 324s > ## Check various combinations of diff arguments 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, NULL, NULL, 324s + tree(commits(repo)[[1]]), 324s + FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, NULL, NULL, 324s + tree(commits(repo)[[1]]), 324s + TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 324s + NULL, FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 324s + NULL, TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 324s + tree(commits(repo)[[2]]), FALSE, NULL, 3L, 0L, "a", 324s + "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > res <- tools::assertError( 324s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 324s + tree(commits(repo)[[2]]), TRUE, NULL, 3L, 0L, "a", 324s + "b", NULL, NULL, NULL)) 324s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 324s + res[[1]]$message)) > 0) 324s > 324s > ## TODO: printing 324s > 324s > ## Cleanup 324s > unlink(path, recursive = TRUE) 324s > 324s BEGIN TEST fast_forward_merge.R 324s 324s R version 4.4.3 (2025-02-28) -- "Trophy Case" 324s Copyright (C) 2025 The R Foundation for Statistical Computing 324s Platform: aarch64-unknown-linux-gnu 324s 324s R is free software and comes with ABSOLUTELY NO WARRANTY. 324s You are welcome to redistribute it under certain conditions. 324s Type 'license()' or 'licence()' for distribution details. 324s 324s R is a collaborative project with many contributors. 324s Type 'contributors()' for more information and 324s 'citation()' on how to cite R or R packages in publications. 324s 324s Type 'demo()' for some demos, 'help()' for on-line help, or 324s 'help.start()' for an HTML browser interface to help. 324s Type 'q()' to quit R. 324s 324s > ## git2r, R bindings to the libgit2 library. 324s > ## Copyright (C) 2013-2023 The git2r contributors 324s > ## 324s > ## This program is free software; you can redistribute it and/or modify 324s > ## it under the terms of the GNU General Public License, version 2, 324s > ## as published by the Free Software Foundation. 324s > ## 324s > ## git2r is distributed in the hope that it will be useful, 324s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 324s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 324s > ## GNU General Public License for more details. 324s > ## 324s > ## You should have received a copy of the GNU General Public License along 324s > ## with this program; if not, write to the Free Software Foundation, Inc., 324s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 324s > 324s > library(git2r) 324s > 324s > ## For debugging 324s > sessionInfo() 324s R version 4.4.3 (2025-02-28) 324s Platform: aarch64-unknown-linux-gnu 324s Running under: Ubuntu Plucky Puffin (development branch) 324s 324s Matrix products: default 324s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 324s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 324s 324s locale: 324s [1] C 324s 324s time zone: Etc/UTC 324s tzcode source: system (glibc) 324s 324s attached base packages: 324s [1] stats graphics grDevices utils datasets methods base 324s 324s other attached packages: 324s [1] git2r_0.35.0 324s 324s loaded via a namespace (and not attached): 324s [1] compiler_4.4.3 324s > libgit2_version() 324s $major 324s [1] 1 324s 324s $minor 324s [1] 9 324s 324s $rev 324s [1] 0 324s 324s > libgit2_features() 324s $threads 324s [1] TRUE 324s 324s $https 324s [1] TRUE 324s 324s $ssh 324s [1] TRUE 324s 324s > 324s > 324s > ## Create directory for repository in tempdir 324s > path <- tempfile(pattern = "git2r-") 324s > dir.create(path) 324s > 324s > ## Create repository 324s > repo <- init(path, branch = "main") 324s > config(repo, user.name = "Alice", user.email = "alice@example.org") 324s > 324s > ## Add changes to repo 324s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 324s + con = file.path(path, "test-1.txt")) 324s > add(repo, "test-1.txt") 324s > commit_1 <- commit(repo, "First commit message") 324s > 324s > ## Create branch and checkout 324s > checkout(branch_create(commit_1, name = "test")) 324s > 324s > ## Add changes to test branch 324s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 324s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 324s + con = file.path(path, "test-1.txt")) 324s > add(repo, "test-1.txt") 324s > commit_2 <- commit(repo, "Second commit message") 324s > 324s > # Checkout main and merge 324s > b <- branches(repo) 324s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 324s > m <- merge(b[sapply(b, "[", "name") == "test"][[1]]) 324s > 324s > # Check merge 324s > stopifnot(inherits(m, "git_merge_result")) 324s > stopifnot(identical(m$up_to_date, FALSE)) 324s > stopifnot(identical(m$fast_forward, TRUE)) 324s > stopifnot(identical(m$conflicts, FALSE)) 324s > stopifnot(identical(sha(m), NA_character_)) 324s > stopifnot(identical(length(commits(repo)), 2L)) 324s > 324s > # Check reflog 324s > r <- reflog(repo) 324s > stopifnot(identical(r[[1]]$message, "merge test: Fast-forward")) 324s > 324s > ## Cleanup 324s > unlink(path, recursive = TRUE) 324s > 325s BEGIN TEST fetch.R 325s 325s R version 4.4.3 (2025-02-28) -- "Trophy Case" 325s Copyright (C) 2025 The R Foundation for Statistical Computing 325s Platform: aarch64-unknown-linux-gnu 325s 325s R is free software and comes with ABSOLUTELY NO WARRANTY. 325s You are welcome to redistribute it under certain conditions. 325s Type 'license()' or 'licence()' for distribution details. 325s 325s R is a collaborative project with many contributors. 325s Type 'contributors()' for more information and 325s 'citation()' on how to cite R or R packages in publications. 325s 325s Type 'demo()' for some demos, 'help()' for on-line help, or 325s 'help.start()' for an HTML browser interface to help. 325s Type 'q()' to quit R. 325s 325s > ## git2r, R bindings to the libgit2 library. 325s > ## Copyright (C) 2013-2023 The git2r contributors 325s > ## 325s > ## This program is free software; you can redistribute it and/or modify 325s > ## it under the terms of the GNU General Public License, version 2, 325s > ## as published by the Free Software Foundation. 325s > ## 325s > ## git2r is distributed in the hope that it will be useful, 325s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 325s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 325s > ## GNU General Public License for more details. 325s > ## 325s > ## You should have received a copy of the GNU General Public License along 325s > ## with this program; if not, write to the Free Software Foundation, Inc., 325s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 325s > 325s > library(git2r) 325s > 325s > ## For debugging 325s > sessionInfo() 325s R version 4.4.3 (2025-02-28) 325s Platform: aarch64-unknown-linux-gnu 325s Running under: Ubuntu Plucky Puffin (development branch) 325s 325s Matrix products: default 325s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 325s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 325s 325s locale: 325s [1] C 325s 325s time zone: Etc/UTC 325s tzcode source: system (glibc) 325s 325s attached base packages: 325s [1] stats graphics grDevices utils datasets methods base 325s 325s other attached packages: 325s [1] git2r_0.35.0 325s 325s loaded via a namespace (and not attached): 325s [1] compiler_4.4.3 325s > libgit2_version() 325s $major 325s [1] 1 325s 325s $minor 325s [1] 9 325s 325s $rev 325s [1] 0 325s 325s > libgit2_features() 325s $threads 325s [1] TRUE 325s 325s $https 325s [1] TRUE 325s 325s $ssh 325s [1] TRUE 325s 325s > 325s > 325s > ## Create 2 directories in tempdir 325s > path_bare <- tempfile(pattern = "git2r-") 325s > path_repo_1 <- tempfile(pattern = "git2r-") 325s > path_repo_2 <- tempfile(pattern = "git2r-") 325s > 325s > dir.create(path_bare) 325s > dir.create(path_repo_1) 325s > dir.create(path_repo_2) 325s > 325s > ## Create repositories 325s > bare_repo <- init(path_bare, bare = TRUE) 325s > repo_1 <- clone(path_bare, path_repo_1) 325s cloning into '/tmp/RtmpR1LXjE/git2r-9b4253f9fb'... 325s > repo_2 <- clone(path_bare, path_repo_2) 325s cloning into '/tmp/RtmpR1LXjE/git2r-9b438aa1990'... 325s > 325s > ## Config repositories 325s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 325s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 325s > 325s > ## Add changes to repo 1 325s > writeLines("Hello world", con = file.path(path_repo_1, "test.txt")) 325s > add(repo_1, "test.txt") 325s > commit_1 <- commit(repo_1, "Commit message") 325s > branch_name <- branches(repo_1)[[1]]$name 325s > 325s > ## Push changes from repo 1 to origin 325s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 325s > 325s > ## Check result in bare repository 325s > stopifnot(identical(length(commits(bare_repo)), 1L)) 325s > bare_commit_1 <- commits(bare_repo)[[1]] 325s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 325s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 325s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 325s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 325s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 325s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 325s > 325s > ## Fetch 325s > fetch(repo_2, "origin") 325s [new] df6ee743d8535e218f1f refs/remotes/origin/master 325s > fh <- fetch_heads(repo_2)[[1]] 325s > stopifnot(identical(sha(fh), fh$sha)) 325s > 325s > ## Test show method of non-empty repository where head is null 325s > show(repo_2) 325s Local: /tmp/RtmpR1LXjE/git2r-9b438aa1990 325s Head: nothing commited (yet) 325s > 325s > ## Check that 'git2r_arg_check_credentials' raise error 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", 325s + 3, "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", repo_1, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- cred_env(c("username", "username"), "password") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- cred_env("username", c("password", "passowrd")) 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- cred_user_pass(c("username", "username"), "password") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- cred_user_pass("username", c("password", "passowrd")) 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- cred_token(c("GITHUB_PAT", "GITHUB_PAT")) 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- structure(list(publickey = c("id_rsa.pub", "id_rsa.pub"), 325s + privatekey = "id_rsa", 325s + passphrase = character(0)), 325s + class = "cred_ssh_key") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- structure(list(publickey = "id_rsa.pub", 325s + privatekey = c("id_rsa", "id_rsa"), 325s + passphrase = character(0)), 325s + class = "cred_ssh_key") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- structure(list(publickey = "id_rsa.pub", 325s + privatekey = "id_rsa", 325s + passphrase = NA_character_), 325s + class = "cred_ssh_key") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > credentials <- structure(list(publickey = "id_rsa.pub", 325s + privatekey = "id_rsa", 325s + passphrase = c("passphrase", "passphrase")), 325s + class = "cred_ssh_key") 325s > res <- tools::assertError( 325s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 325s + "fetch", FALSE, NULL)) 325s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 325s + res[[1]]$message)) > 0) 325s > 325s > ## Cleanup 325s > unlink(path_bare, recursive = TRUE) 325s > unlink(path_repo_1, recursive = TRUE) 325s > unlink(path_repo_2, recursive = TRUE) 325s > 325s BEGIN TEST graph.R 325s 325s R version 4.4.3 (2025-02-28) -- "Trophy Case" 325s Copyright (C) 2025 The R Foundation for Statistical Computing 325s Platform: aarch64-unknown-linux-gnu 325s 325s R is free software and comes with ABSOLUTELY NO WARRANTY. 325s You are welcome to redistribute it under certain conditions. 325s Type 'license()' or 'licence()' for distribution details. 325s 325s R is a collaborative project with many contributors. 325s Type 'contributors()' for more information and 325s 'citation()' on how to cite R or R packages in publications. 325s 325s Type 'demo()' for some demos, 'help()' for on-line help, or 325s 'help.start()' for an HTML browser interface to help. 325s Type 'q()' to quit R. 325s 325s > ## git2r, R bindings to the libgit2 library. 325s > ## Copyright (C) 2013-2023 The git2r contributors 325s > ## 325s > ## This program is free software; you can redistribute it and/or modify 325s > ## it under the terms of the GNU General Public License, version 2, 325s > ## as published by the Free Software Foundation. 325s > ## 325s > ## git2r is distributed in the hope that it will be useful, 325s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 325s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 325s > ## GNU General Public License for more details. 325s > ## 325s > ## You should have received a copy of the GNU General Public License along 325s > ## with this program; if not, write to the Free Software Foundation, Inc., 325s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 325s > 325s > library("git2r") 325s > 325s > ## For debugging 325s > sessionInfo() 325s R version 4.4.3 (2025-02-28) 325s Platform: aarch64-unknown-linux-gnu 325s Running under: Ubuntu Plucky Puffin (development branch) 325s 325s Matrix products: default 325s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 325s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 325s 325s locale: 325s [1] C 325s 325s time zone: Etc/UTC 325s tzcode source: system (glibc) 325s 325s attached base packages: 325s [1] stats graphics grDevices utils datasets methods base 325s 325s other attached packages: 325s [1] git2r_0.35.0 325s 325s loaded via a namespace (and not attached): 325s [1] compiler_4.4.3 325s > libgit2_version() 325s $major 325s [1] 1 325s 325s $minor 325s [1] 9 325s 325s $rev 325s [1] 0 325s 325s > libgit2_features() 325s $threads 325s [1] TRUE 325s 325s $https 325s [1] TRUE 325s 325s $ssh 325s [1] TRUE 325s 325s > 325s > 325s > ## Create a directory in tempdir 325s > path <- tempfile(pattern = "git2r-") 325s > dir.create(path) 325s > 325s > ## Initialize a repository 325s > repo <- init(path) 325s > config(repo, user.name = "Alice", user.email = "alice@example.org") 325s > 325s > ## Create a file and commit 325s > writeLines("Hello world!", file.path(path, "test.txt")) 325s > add(repo, "test.txt") 325s > commit_1 <- commit(repo, "First commit message") 325s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 325s > 325s > ## Change file and commit 325s > writeLines(c("Hello world!", "HELLO WORLD!"), 325s + file.path(path, "test.txt")) 325s > add(repo, "test.txt") 325s > commit_2 <- commit(repo, "Second commit message") 325s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 325s > 325s > ## Check ahead behind 325s > stopifnot(identical(ahead_behind(commit_1, commit_2), c(0L, 1L))) 325s > stopifnot(identical(ahead_behind(tag_1, tag_2), c(0L, 1L))) 325s > stopifnot(identical(ahead_behind(tag_2, tag_1), c(1L, 0L))) 325s > stopifnot(identical(ahead_behind(commit_1, branches(repo)[[1]]), c(0L, 1L))) 325s > stopifnot(identical(ahead_behind(branches(repo)[[1]], commit_1), c(1L, 0L))) 325s > 325s > ## Cleanup 325s > unlink(path, recursive = TRUE) 325s > 325s BEGIN TEST index.R 325s 325s R version 4.4.3 (2025-02-28) -- "Trophy Case" 325s Copyright (C) 2025 The R Foundation for Statistical Computing 325s Platform: aarch64-unknown-linux-gnu 325s 325s R is free software and comes with ABSOLUTELY NO WARRANTY. 325s You are welcome to redistribute it under certain conditions. 325s Type 'license()' or 'licence()' for distribution details. 325s 325s R is a collaborative project with many contributors. 325s Type 'contributors()' for more information and 325s 'citation()' on how to cite R or R packages in publications. 325s 325s Type 'demo()' for some demos, 'help()' for on-line help, or 325s 'help.start()' for an HTML browser interface to help. 325s Type 'q()' to quit R. 325s 325s > ## git2r, R bindings to the libgit2 library. 325s > ## Copyright (C) 2013-2023 The git2r contributors 325s > ## 325s > ## This program is free software; you can redistribute it and/or modify 325s > ## it under the terms of the GNU General Public License, version 2, 325s > ## as published by the Free Software Foundation. 325s > ## 325s > ## git2r is distributed in the hope that it will be useful, 325s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 325s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 325s > ## GNU General Public License for more details. 325s > ## 325s > ## You should have received a copy of the GNU General Public License along 325s > ## with this program; if not, write to the Free Software Foundation, Inc., 325s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 325s > 325s > library(git2r) 325s > source("util/check.R") 325s > 325s > ## For debugging 325s > sessionInfo() 325s R version 4.4.3 (2025-02-28) 325s Platform: aarch64-unknown-linux-gnu 325s Running under: Ubuntu Plucky Puffin (development branch) 325s 325s Matrix products: default 325s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 325s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 325s 325s locale: 325s [1] C 325s 325s time zone: Etc/UTC 325s tzcode source: system (glibc) 325s 325s attached base packages: 325s [1] stats graphics grDevices utils datasets methods base 325s 325s other attached packages: 325s [1] git2r_0.35.0 325s 325s loaded via a namespace (and not attached): 325s [1] compiler_4.4.3 325s > libgit2_version() 325s $major 325s [1] 1 325s 325s $minor 325s [1] 9 325s 325s $rev 325s [1] 0 325s 325s > libgit2_features() 325s $threads 325s [1] TRUE 325s 325s $https 325s [1] TRUE 325s 325s $ssh 325s [1] TRUE 325s 325s > 325s > 325s > ## Create a directory in tempdir 325s > path <- tempfile(pattern = "git2r-") 325s > dir.create(path) 325s > 325s > ## Initialize a repository 325s > repo <- init(path) 325s > config(repo, user.name = "Alice", user.email = "alice@example.org") 325s > 325s > ## Create directories 325s > dir.create(file.path(path, "sub-folder")); 325s > dir.create(file.path(path, "sub-folder", "sub-sub-folder")); 325s > 325s > ## Create files 325s > writeLines("Hello world!", 325s + file.path(path, "file-1.txt")) 325s > writeLines("Hello world!", 325s + file.path(path, "sub-folder", "file-2.txt")) 325s > writeLines("Hello world!", 325s + file.path(path, "sub-folder", "file-3.txt")) 325s > writeLines("Hello world!", 325s + file.path(path, "sub-folder", "sub-sub-folder", "file-4.txt")) 325s > writeLines("Hello world!", 325s + file.path(path, "sub-folder", "sub-sub-folder", "file-5.txt")) 325s > 325s > ## Add 325s > add(repo, "file-1.txt") 325s > status_exp <- structure(list(staged = list(new = "file-1.txt"), 325s + unstaged = empty_named_list(), 325s + untracked = list(untracked = "sub-folder/")), 325s + class = "git_status") 325s > status_obs <- status(repo) 325s > stopifnot(identical(status_obs, status_exp)) 325s > 325s > ## Index remove by path 325s > index_remove_bypath(repo, "file-1.txt") 325s > status_exp <- structure(list(staged = empty_named_list(), 325s + unstaged = empty_named_list(), 325s + untracked = list(untracked = "file-1.txt", 325s + untracked = "sub-folder/")), 325s + class = "git_status") 325s > status_obs <- status(repo) 325s > stopifnot(identical(status_obs, status_exp)) 325s > 325s > ## Add 325s > add(repo, "sub-folder") 325s > status_exp <- structure(list(staged = list( 325s + new = "sub-folder/file-2.txt", 325s + new = "sub-folder/file-3.txt", 325s + new = "sub-folder/sub-sub-folder/file-4.txt", 325s + new = "sub-folder/sub-sub-folder/file-5.txt"), 325s + unstaged = empty_named_list(), 325s + untracked = list(untracked = "file-1.txt")), 325s + class = "git_status") 325s > status_obs <- status(repo) 325s > stopifnot(identical(status_obs, status_exp)) 325s > 325s > ## Commit 325s > commit(repo, "First commit message") 325s [8fdea4d] 2025-03-15: First commit message 325s > 325s > ## It should fail to remove non-existing, untracked and ignored files 325s > tools::assertError(rm_file(repo, c("file-1.txt", "file-2.txt"))) 325s > tools::assertError(rm_file(repo, c("file-1.txt", ""))) 325s > tools::assertError(rm_file(repo, c("file-1.txt"))) 325s > writeLines("/file-1.txt", file.path(path, ".gitignore")) 325s > tools::assertError(rm_file(repo, "file-1.txt")) 325s > 325s > ## It should fail to remove files with staged changes 325s > file.remove(file.path(path, ".gitignore")) 325s [1] TRUE 325s > add(repo, "file-1.txt") 325s > tools::assertError(rm_file(repo, "file-1.txt")) 325s > 325s > ## It should fail to remove files with unstaged changes 325s > commit(repo, "Second commit message") 325s [563b3f9] 2025-03-15: Second commit message 325s > writeLines(c("Hello world!", "Hello world!"), 325s + file.path(path, "file-1.txt")) 325s > tools::assertError(rm_file(repo, "file-1.txt")) 325s > 325s > ## Remove file 325s > add(repo, "file-1.txt") 325s > commit(repo, "Third commit message") 325s [e67f356] 2025-03-15: Third commit message 325s > rm_file(repo, "file-1.txt") 325s > status_exp <- structure(list(staged = list(deleted = "file-1.txt"), 325s + unstaged = empty_named_list(), 325s + untracked = empty_named_list()), 325s + class = "git_status") 325s > status_obs <- status(repo) 325s > stopifnot(identical(status_obs, status_exp)) 325s > 325s > ## Cleanup 325s > unlink(path, recursive = TRUE) 325s > 325s BEGIN TEST invalid-conf-var.R 325s 325s R version 4.4.3 (2025-02-28) -- "Trophy Case" 325s Copyright (C) 2025 The R Foundation for Statistical Computing 325s Platform: aarch64-unknown-linux-gnu 325s 325s R is free software and comes with ABSOLUTELY NO WARRANTY. 325s You are welcome to redistribute it under certain conditions. 325s Type 'license()' or 'licence()' for distribution details. 325s 325s R is a collaborative project with many contributors. 325s Type 'contributors()' for more information and 325s 'citation()' on how to cite R or R packages in publications. 325s 325s Type 'demo()' for some demos, 'help()' for on-line help, or 325s 'help.start()' for an HTML browser interface to help. 325s Type 'q()' to quit R. 325s 326s > ## git2r, R bindings to the libgit2 library. 326s > ## Copyright (C) 2013-2023 The git2r contributors 326s > ## 326s > ## This program is free software; you can redistribute it and/or modify 326s > ## it under the terms of the GNU General Public License, version 2, 326s > ## as published by the Free Software Foundation. 326s > ## 326s > ## git2r is distributed in the hope that it will be useful, 326s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 326s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 326s > ## GNU General Public License for more details. 326s > ## 326s > ## You should have received a copy of the GNU General Public License along 326s > ## with this program; if not, write to the Free Software Foundation, Inc., 326s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 326s > 326s > library("git2r") 326s > 326s > ## For debugging 326s > sessionInfo() 326s R version 4.4.3 (2025-02-28) 326s Platform: aarch64-unknown-linux-gnu 326s Running under: Ubuntu Plucky Puffin (development branch) 326s 326s Matrix products: default 326s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 326s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 326s 326s locale: 326s [1] C 326s 326s time zone: Etc/UTC 326s tzcode source: system (glibc) 326s 326s attached base packages: 326s [1] stats graphics grDevices utils datasets methods base 326s 326s other attached packages: 326s [1] git2r_0.35.0 326s 326s loaded via a namespace (and not attached): 326s [1] compiler_4.4.3 326s > libgit2_version() 326s $major 326s [1] 1 326s 326s $minor 326s [1] 9 326s 326s $rev 326s [1] 0 326s 326s > libgit2_features() 326s $threads 326s [1] TRUE 326s 326s $https 326s [1] TRUE 326s 326s $ssh 326s [1] TRUE 326s 326s > 326s > 326s > ## Create a directory in tempdir 326s > path <- tempfile(pattern = "git2r-") 326s > dir.create(path) 326s > 326s > ## Initialize a repository 326s > repo <- init(path) 326s > 326s > ## Config repository 326s > config(repo, user.name = "Alice") 326s > 326s > ## Let's set one valid and one with variable with invalid format 326s > res <- tools::assertWarning(config(repo, 326s + user.email = "alice@example.org", 326s + lol = "wut")) 326s > stopifnot(length(grep("Variable was not in a valid format: 'lol'", 326s + res[[1]]$message)) > 0) 326s > 326s > cfg_exp <- structure(list(user.name = "Alice", 326s + user.email = "alice@example.org", 326s + "NA" = NULL), 326s + .Names = c("user.name", "user.email", NA)) 326s > 326s > cfg_obs <- config(repo)$local 326s > cfg_obs <- cfg_obs[c("user.name", "user.email", "lol")] 326s > stopifnot(identical(cfg_obs, cfg_exp)) 326s > 326s > ## Cleanup 326s > unlink(path, recursive = TRUE) 326s > 326s BEGIN TEST libgit2.R 326s 326s R version 4.4.3 (2025-02-28) -- "Trophy Case" 326s Copyright (C) 2025 The R Foundation for Statistical Computing 326s Platform: aarch64-unknown-linux-gnu 326s 326s R is free software and comes with ABSOLUTELY NO WARRANTY. 326s You are welcome to redistribute it under certain conditions. 326s Type 'license()' or 'licence()' for distribution details. 326s 326s R is a collaborative project with many contributors. 326s Type 'contributors()' for more information and 326s 'citation()' on how to cite R or R packages in publications. 326s 326s Type 'demo()' for some demos, 'help()' for on-line help, or 326s 'help.start()' for an HTML browser interface to help. 326s Type 'q()' to quit R. 326s 326s > ## git2r, R bindings to the libgit2 library. 326s > ## Copyright (C) 2013-2023 The git2r contributors 326s > ## 326s > ## This program is free software; you can redistribute it and/or modify 326s > ## it under the terms of the GNU General Public License, version 2, 326s > ## as published by the Free Software Foundation. 326s > ## 326s > ## git2r is distributed in the hope that it will be useful, 326s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 326s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 326s > ## GNU General Public License for more details. 326s > ## 326s > ## You should have received a copy of the GNU General Public License along 326s > ## with this program; if not, write to the Free Software Foundation, Inc., 326s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 326s > 326s > library("git2r") 326s > 326s > ## For debugging 326s > sessionInfo() 326s R version 4.4.3 (2025-02-28) 326s Platform: aarch64-unknown-linux-gnu 326s Running under: Ubuntu Plucky Puffin (development branch) 326s 326s Matrix products: default 326s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 326s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 326s 326s locale: 326s [1] C 326s 326s time zone: Etc/UTC 326s tzcode source: system (glibc) 326s 326s attached base packages: 326s [1] stats graphics grDevices utils datasets methods base 326s 326s other attached packages: 326s [1] git2r_0.35.0 326s 326s loaded via a namespace (and not attached): 326s [1] compiler_4.4.3 326s > libgit2_version() 326s $major 326s [1] 1 326s 326s $minor 326s [1] 9 326s 326s $rev 326s [1] 0 326s 326s > libgit2_features() 326s $threads 326s [1] TRUE 326s 326s $https 326s [1] TRUE 326s 326s $ssh 326s [1] TRUE 326s 326s > 326s > 326s > stopifnot(identical(names(libgit2_features()), 326s + c("threads", "https", "ssh"))) 326s > 326s > stopifnot(identical(names(libgit2_version()), 326s + c("major", "minor", "rev"))) 326s > 326s > tools::assertError(ssl_cert_locations()) 326s > 326s > if (identical(Sys.getenv("R_COVR"), "true")) { 326s + if (isTRUE(libgit2_features()$https)) { 326s + ## Create a directory in tempdir 326s + path <- tempfile(pattern = "git2r-") 326s + dir.create(path) 326s + stopifnot(is.null(ssl_cert_locations(path = path))) 326s + unlink(path) 326s + } 326s + } 326s > 326s BEGIN TEST ls_tree.R 326s 326s R version 4.4.3 (2025-02-28) -- "Trophy Case" 326s Copyright (C) 2025 The R Foundation for Statistical Computing 326s Platform: aarch64-unknown-linux-gnu 326s 326s R is free software and comes with ABSOLUTELY NO WARRANTY. 326s You are welcome to redistribute it under certain conditions. 326s Type 'license()' or 'licence()' for distribution details. 326s 326s R is a collaborative project with many contributors. 326s Type 'contributors()' for more information and 326s 'citation()' on how to cite R or R packages in publications. 326s 326s Type 'demo()' for some demos, 'help()' for on-line help, or 326s 'help.start()' for an HTML browser interface to help. 326s Type 'q()' to quit R. 326s 326s > ## git2r, R bindings to the libgit2 library. 326s > ## Copyright (C) 2013-2023 The git2r contributors 326s > ## 326s > ## This program is free software; you can redistribute it and/or modify 326s > ## it under the terms of the GNU General Public License, version 2, 326s > ## as published by the Free Software Foundation. 326s > ## 326s > ## git2r is distributed in the hope that it will be useful, 326s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 326s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 326s > ## GNU General Public License for more details. 326s > ## 326s > ## You should have received a copy of the GNU General Public License along 326s > ## with this program; if not, write to the Free Software Foundation, Inc., 326s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 326s > 326s > library("git2r") 326s > 326s > ## For debugging 326s > sessionInfo() 326s R version 4.4.3 (2025-02-28) 326s Platform: aarch64-unknown-linux-gnu 326s Running under: Ubuntu Plucky Puffin (development branch) 326s 326s Matrix products: default 326s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 326s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 326s 326s locale: 326s [1] C 326s 326s time zone: Etc/UTC 326s tzcode source: system (glibc) 326s 326s attached base packages: 326s [1] stats graphics grDevices utils datasets methods base 326s 326s other attached packages: 326s [1] git2r_0.35.0 326s 326s loaded via a namespace (and not attached): 326s [1] compiler_4.4.3 326s > libgit2_version() 326s $major 326s [1] 1 326s 326s $minor 326s [1] 9 326s 326s $rev 326s [1] 0 326s 326s > libgit2_features() 326s $threads 326s [1] TRUE 326s 326s $https 326s [1] TRUE 326s 326s $ssh 326s [1] TRUE 326s 326s > 326s > 326s > ## Initialize a temporary repository 326s > path <- tempfile(pattern = "git2r-") 326s > dir.create(path) 326s > dir.create(file.path(path, "subfolder")) 326s > repo <- init(path) 326s > 326s > ## Create a user 326s > config(repo, user.name = "Alice", user.email = "alice@example.org") 326s > 326s > ## Create three files and commit 326s > writeLines("First file", file.path(path, "example-1.txt")) 326s > writeLines("Second file", file.path(path, "subfolder/example-2.txt")) 326s > writeLines("Third file", file.path(path, "example-3.txt")) 326s > add(repo, c("example-1.txt", "subfolder/example-2.txt", "example-3.txt")) 326s > commit(repo, "Commit message") 326s [d27946a] 2025-03-15: Commit message 326s > 326s > ## Traverse tree entries and its subtrees. 326s > ## Various approaches that give identical result. 326s > stopifnot(identical(ls_tree(tree = tree(last_commit(path))), 326s + ls_tree(tree = tree(last_commit(repo))))) 326s > stopifnot(identical(ls_tree(repo = path), ls_tree(repo = repo))) 326s > 326s > ## ls_tree(repo = repo) should match `git ls-tree -lr HEAD` 326s > ls_tree_result <- ls_tree(repo = repo) 326s > stopifnot(identical(ls_tree_result$name, 326s + c("example-1.txt", "example-3.txt", "example-2.txt"))) 326s > 326s > # Argument `tree` can be a 'character that identifies a tree in the repository' 326s > ls_tree(tree = tree(last_commit(path))$sha, repo = repo) 326s mode type sha path name 326s 1 100644 blob 4c5fd919d52e3c1b08f7924cfa05d6de100912fd example-1.txt 326s 2 100644 blob f89598da398eb016c504a5e272cb3eb1a31e2687 example-3.txt 326s 3 100644 blob 20d5b672a347112783818b3fc8cc7cd66ade3008 subfolder/ example-2.txt 326s len 326s 1 11 326s 2 11 326s 3 12 326s > 326s > ## Skip content in subfolder 326s > ls_tree_toplevel <- ls_tree(repo = repo, recursive = FALSE) 326s > stopifnot(nrow(ls_tree_toplevel) == 3) 326s > stopifnot(identical(ls_tree_toplevel$name, 326s + c("example-1.txt", "example-3.txt", "subfolder"))) 326s > 326s > ## Start in subfolder 326s > ls_tree_subfolder <- ls_tree(tree = "HEAD:subfolder", repo = repo) 326s > stopifnot(nrow(ls_tree_subfolder) == 1) 326s > stopifnot(identical(ls_tree_subfolder$name, "example-2.txt")) 326s > 326s > ## Cleanup 326s > unlink(path, recursive = TRUE) 326s > 326s BEGIN TEST merge.R 326s 326s R version 4.4.3 (2025-02-28) -- "Trophy Case" 326s Copyright (C) 2025 The R Foundation for Statistical Computing 326s Platform: aarch64-unknown-linux-gnu 326s 326s R is free software and comes with ABSOLUTELY NO WARRANTY. 326s You are welcome to redistribute it under certain conditions. 326s Type 'license()' or 'licence()' for distribution details. 326s 326s R is a collaborative project with many contributors. 326s Type 'contributors()' for more information and 326s 'citation()' on how to cite R or R packages in publications. 326s 326s Type 'demo()' for some demos, 'help()' for on-line help, or 326s 'help.start()' for an HTML browser interface to help. 326s Type 'q()' to quit R. 326s 326s > ## git2r, R bindings to the libgit2 library. 326s > ## Copyright (C) 2013-2023 The git2r contributors 326s > ## 326s > ## This program is free software; you can redistribute it and/or modify 326s > ## it under the terms of the GNU General Public License, version 2, 326s > ## as published by the Free Software Foundation. 326s > ## 326s > ## git2r is distributed in the hope that it will be useful, 326s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 326s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 326s > ## GNU General Public License for more details. 326s > ## 326s > ## You should have received a copy of the GNU General Public License along 326s > ## with this program; if not, write to the Free Software Foundation, Inc., 326s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 326s > 326s > library(git2r) 326s > source("util/check.R") 326s > 326s > ## For debugging 326s > sessionInfo() 326s R version 4.4.3 (2025-02-28) 326s Platform: aarch64-unknown-linux-gnu 326s Running under: Ubuntu Plucky Puffin (development branch) 326s 326s Matrix products: default 326s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 326s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 326s 326s locale: 326s [1] C 326s 326s time zone: Etc/UTC 326s tzcode source: system (glibc) 326s 326s attached base packages: 326s [1] stats graphics grDevices utils datasets methods base 326s 326s other attached packages: 326s [1] git2r_0.35.0 326s 326s loaded via a namespace (and not attached): 326s [1] compiler_4.4.3 326s > libgit2_version() 326s $major 326s [1] 1 326s 326s $minor 326s [1] 9 326s 326s $rev 326s [1] 0 326s 326s > libgit2_features() 326s $threads 326s [1] TRUE 326s 326s $https 326s [1] TRUE 326s 326s $ssh 326s [1] TRUE 326s 326s > 326s > 326s > ## Create a directory in tempdir 326s > path <- tempfile(pattern = "git2r-") 326s > dir.create(path) 326s > 326s > ## Initialize a repository 326s > repo <- init(path, branch = "main") 326s > config(repo, user.name = "Alice", user.email = "alice@example.org") 326s > 326s > ## Create a file, add and commit 326s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 326s + con = file.path(path, "test.txt")) 326s > add(repo, "test.txt") 326s > commit_1 <- commit(repo, "Commit message 1") 326s > 326s > ## Create first branch, checkout, add file and commit 326s > b_1 <- branch_create(commit_1, "branch1") 326s > checkout(b_1) 326s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 326s > add(repo, "branch-1.txt") 326s > commit_2 <- commit(repo, "Commit message branch 1") 326s > 326s > ## Create second branch, checkout, add file and commit 326s > b_2 <- branch_create(commit_1, "branch2") 326s > checkout(b_2) 326s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 326s > add(repo, "branch-2.txt") 326s > commit_3 <- commit(repo, "Commit message branch 2") 327s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit_4 <- commit(repo, "Second commit message branch 2") 327s > 327s > ## Check that merge base equals commit_1 327s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 327s > 327s > ## Checkout main 327s > b <- branches(repo) 327s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 327s > 327s > ## Merge branch 1 327s > m_1 <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 327s > stopifnot(identical(m_1$fast_forward, TRUE)) 327s > stopifnot(identical(m_1$conflicts, FALSE)) 327s > stopifnot(identical(sha(m_1), NA_character_)) 327s > stopifnot(identical(print(m_1), m_1)) 327s Merge: Fast-forward 327s > 327s > ## Merge branch 1 again 327s > m_1_again <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 327s > stopifnot(identical(m_1_again$up_to_date, TRUE)) 327s > stopifnot(identical(m_1_again$fast_forward, FALSE)) 327s > stopifnot(identical(m_1_again$conflicts, FALSE)) 327s > stopifnot(identical(sha(m_1_again), NA_character_)) 327s > 327s > ## Merge branch 2 327s > m_2 <- merge(b[sapply(b, "[", "name") == "branch2"][[1]]) 327s > stopifnot(identical(m_2$fast_forward, FALSE)) 327s > stopifnot(identical(m_2$conflicts, FALSE)) 327s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 327s > 327s > ## Create third branch, checkout, change file and commit 327s > b_3 <- branch_create(lookup(repo, sha(m_2)), "branch3") 327s > checkout(b_3) 327s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit(repo, "Commit message branch 3") 327s [367c4a4] 2025-03-15: Commit message branch 3 327s > 327s > ## Checkout main and create a change that creates a conflict on 327s > ## merge 327s > b <- branches(repo) 327s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 327s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit(repo, "Some commit message branch 1") 327s [e371757] 2025-03-15: Some commit message branch 1 327s > 327s > ## Merge branch 3 with fail = TRUE 327s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]], fail = TRUE) 327s > stopifnot(identical(m_3$up_to_date, FALSE)) 327s > stopifnot(identical(m_3$fast_forward, FALSE)) 327s > stopifnot(identical(m_3$conflicts, TRUE)) 327s > stopifnot(identical(sha(m_3), NA_character_)) 327s > m_3 327s Merge: Conflicts 327s > 327s > ## Check status; Expect to have a clean working directory 327s > wd <- structure(list(staged = empty_named_list(), 327s + unstaged = empty_named_list(), 327s + untracked = empty_named_list()), 327s + class = "git_status") 327s > stopifnot(identical(status(repo), wd)) 327s > 327s > ## Merge branch 3 327s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]]) 327s > stopifnot(identical(m_3$up_to_date, FALSE)) 327s > stopifnot(identical(m_3$fast_forward, FALSE)) 327s > stopifnot(identical(m_3$conflicts, TRUE)) 327s > stopifnot(identical(sha(m_3), NA_character_)) 327s > m_3 327s Merge: Conflicts 327s > 327s > ## Check status; Expect to have one unstaged unmerged conflict. 327s > stopifnot(identical(status(repo), 327s + structure(list(staged = empty_named_list(), 327s + unstaged = list(conflicted = "test.txt"), 327s + untracked = empty_named_list()), 327s + class = "git_status"))) 327s > 327s > ## Cleanup 327s > unlink(path, recursive = TRUE) 327s > 327s BEGIN TEST merge_named_branch.R 327s 327s R version 4.4.3 (2025-02-28) -- "Trophy Case" 327s Copyright (C) 2025 The R Foundation for Statistical Computing 327s Platform: aarch64-unknown-linux-gnu 327s 327s R is free software and comes with ABSOLUTELY NO WARRANTY. 327s You are welcome to redistribute it under certain conditions. 327s Type 'license()' or 'licence()' for distribution details. 327s 327s R is a collaborative project with many contributors. 327s Type 'contributors()' for more information and 327s 'citation()' on how to cite R or R packages in publications. 327s 327s Type 'demo()' for some demos, 'help()' for on-line help, or 327s 'help.start()' for an HTML browser interface to help. 327s Type 'q()' to quit R. 327s 327s > ## git2r, R bindings to the libgit2 library. 327s > ## Copyright (C) 2013-2023 The git2r contributors 327s > ## 327s > ## This program is free software; you can redistribute it and/or modify 327s > ## it under the terms of the GNU General Public License, version 2, 327s > ## as published by the Free Software Foundation. 327s > ## 327s > ## git2r is distributed in the hope that it will be useful, 327s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 327s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 327s > ## GNU General Public License for more details. 327s > ## 327s > ## You should have received a copy of the GNU General Public License along 327s > ## with this program; if not, write to the Free Software Foundation, Inc., 327s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 327s > 327s > library(git2r) 327s > source("util/check.R") 327s > 327s > ## For debugging 327s > sessionInfo() 327s R version 4.4.3 (2025-02-28) 327s Platform: aarch64-unknown-linux-gnu 327s Running under: Ubuntu Plucky Puffin (development branch) 327s 327s Matrix products: default 327s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 327s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 327s 327s locale: 327s [1] C 327s 327s time zone: Etc/UTC 327s tzcode source: system (glibc) 327s 327s attached base packages: 327s [1] stats graphics grDevices utils datasets methods base 327s 327s other attached packages: 327s [1] git2r_0.35.0 327s 327s loaded via a namespace (and not attached): 327s [1] compiler_4.4.3 327s > libgit2_version() 327s $major 327s [1] 1 327s 327s $minor 327s [1] 9 327s 327s $rev 327s [1] 0 327s 327s > libgit2_features() 327s $threads 327s [1] TRUE 327s 327s $https 327s [1] TRUE 327s 327s $ssh 327s [1] TRUE 327s 327s > 327s > 327s > ## Create a directory in tempdir 327s > path <- tempfile(pattern = "git2r-") 327s > dir.create(path) 327s > 327s > ## Initialize a repository 327s > repo <- init(path, branch = "main") 327s > config(repo, user.name = "Alice", user.email = "alice@example.org") 327s > 327s > ## Create a file, add and commit 327s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit_1 <- commit(repo, "Commit message 1") 327s > 327s > ## Create first branch, checkout, add file and commit 327s > checkout(repo, "branch1", create = TRUE) 327s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 327s > add(repo, "branch-1.txt") 327s > commit_2 <- commit(repo, "Commit message branch 1") 327s > 327s > ## Create second branch, checkout, add file and commit 327s > b_2 <- branch_create(commit_1, "branch2") 327s > checkout(b_2) 327s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 327s > add(repo, "branch-2.txt") 327s > commit_3 <- commit(repo, "Commit message branch 2") 327s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit_4 <- commit(repo, "Second commit message branch 2") 327s > 327s > ## Check that merge base equals commit_1 327s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 327s > 327s > ## Checkout main 327s > b <- branches(repo) 327s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 327s > 327s > ## Merge branch 1 327s > m_1 <- merge(repo, "branch1") 327s > stopifnot(identical(m_1$fast_forward, TRUE)) 327s > stopifnot(identical(m_1$conflicts, FALSE)) 327s > stopifnot(identical(sha(m_1), NA_character_)) 327s > 327s > ## Merge branch 2 327s > m_2 <- merge(path, "branch2") 327s > stopifnot(identical(m_2$fast_forward, FALSE)) 327s > stopifnot(identical(m_2$conflicts, FALSE)) 327s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 327s > 327s > ## Create third branch, checkout, change file and commit 327s > checkout(repo, "branch3", create = TRUE) 327s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit(repo, "Commit message branch 3") 327s [4197e28] 2025-03-15: Commit message branch 3 327s > 327s > ## Checkout main and create a change that creates a merge conflict 327s > checkout(repo, "main", force = TRUE) 327s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 327s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 327s + con = file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit(repo, "Some commit message branch 1") 327s [0526a76] 2025-03-15: Some commit message branch 1 327s > 327s > ## Merge branch 3 327s > m_3 <- merge(repo, "branch3") 327s > stopifnot(identical(m_3$up_to_date, FALSE)) 327s > stopifnot(identical(m_3$fast_forward, FALSE)) 327s > stopifnot(identical(m_3$conflicts, TRUE)) 327s > stopifnot(identical(sha(m_3), NA_character_)) 327s > 327s > ## Check status; Expect to have one unstaged unmerged conflict. 327s > stopifnot(identical(status(repo), 327s + structure(list(staged = empty_named_list(), 327s + unstaged = list(conflicted = "test.txt"), 327s + untracked = empty_named_list()), 327s + class = "git_status"))) 327s > 327s > ## Cleanup 327s > unlink(path, recursive = TRUE) 327s > 327s BEGIN TEST normal_merge.R 327s 327s R version 4.4.3 (2025-02-28) -- "Trophy Case" 327s Copyright (C) 2025 The R Foundation for Statistical Computing 327s Platform: aarch64-unknown-linux-gnu 327s 327s R is free software and comes with ABSOLUTELY NO WARRANTY. 327s You are welcome to redistribute it under certain conditions. 327s Type 'license()' or 'licence()' for distribution details. 327s 327s R is a collaborative project with many contributors. 327s Type 'contributors()' for more information and 327s 'citation()' on how to cite R or R packages in publications. 327s 327s Type 'demo()' for some demos, 'help()' for on-line help, or 327s 'help.start()' for an HTML browser interface to help. 327s Type 'q()' to quit R. 327s 327s > ## git2r, R bindings to the libgit2 library. 327s > ## Copyright (C) 2013-2023 The git2r contributors 327s > ## 327s > ## This program is free software; you can redistribute it and/or modify 327s > ## it under the terms of the GNU General Public License, version 2, 327s > ## as published by the Free Software Foundation. 327s > ## 327s > ## git2r is distributed in the hope that it will be useful, 327s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 327s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 327s > ## GNU General Public License for more details. 327s > ## 327s > ## You should have received a copy of the GNU General Public License along 327s > ## with this program; if not, write to the Free Software Foundation, Inc., 327s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 327s > 327s > library(git2r) 327s > 327s > ## For debugging 327s > sessionInfo() 327s R version 4.4.3 (2025-02-28) 327s Platform: aarch64-unknown-linux-gnu 327s Running under: Ubuntu Plucky Puffin (development branch) 327s 327s Matrix products: default 327s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 327s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 327s 327s locale: 327s [1] C 327s 327s time zone: Etc/UTC 327s tzcode source: system (glibc) 327s 327s attached base packages: 327s [1] stats graphics grDevices utils datasets methods base 327s 327s other attached packages: 327s [1] git2r_0.35.0 327s 327s loaded via a namespace (and not attached): 327s [1] compiler_4.4.3 327s > libgit2_version() 327s $major 327s [1] 1 327s 327s $minor 327s [1] 9 327s 327s $rev 327s [1] 0 327s 327s > libgit2_features() 327s $threads 327s [1] TRUE 327s 327s $https 327s [1] TRUE 327s 327s $ssh 327s [1] TRUE 327s 327s > 327s > 327s > ## Initialize a temporary repository 327s > path <- tempfile(pattern = "git2r-") 327s > dir.create(path) 327s > repo <- init(path, branch = "main") 327s > 327s > ## Create a user and commit a file 327s > config(repo, user.name = "Author", user.email = "author@example.org") 327s > writeLines(c("First line in file 1.", "Second line in file 1."), 327s + file.path(path, "example-1.txt")) 327s > add(repo, "example-1.txt") 327s > commit(repo, "First commit message") 327s [b39482f] 2025-03-15: First commit message 327s > 327s > ## Create and add one more file 327s > writeLines(c("First line in file 2.", "Second line in file 2."), 327s + file.path(path, "example-2.txt")) 327s > add(repo, "example-2.txt") 327s > commit(repo, "Second commit message") 327s [c6739ff] 2025-03-15: Second commit message 327s > 327s > ## Create a new branch 'fix' 327s > checkout(repo, "fix", create = TRUE) 327s > 327s > ## Update 'example-1.txt' (swap words in first line) and commit 327s > writeLines(c("line First in file 1.", "Second line in file 1."), 327s + file.path(path, "example-1.txt")) 327s > add(repo, "example-1.txt") 327s > commit(repo, "Third commit message") 327s [dab777a] 2025-03-15: Third commit message 327s > 327s > checkout(repo, "main") 327s > 327s > ## Update 'example-2.txt' (swap words in second line) and commit 327s > writeLines(c("First line in file 2.", "line Second in file 2."), 327s + file.path(path, "example-2.txt")) 327s > add(repo, "example-2.txt") 327s > commit(repo, "Fourth commit message") 327s [5d61bfa] 2025-03-15: Fourth commit message 327s > 327s > # Missing branch to merge with should throw an error 327s > tools::assertError(merge(repo)) 327s > 327s > ## Merge 'fix' 327s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 327s > stopifnot(identical(format(m), "Merge")) 327s > 327s > ## Merge 'fix' again 327s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 327s > stopifnot(identical(format(m), "Already up-to-date")) 327s > 327s > ## Check number of parents of each commit 327s > stopifnot(identical(sapply(commits(repo), function(x) length(parents(x))), 327s + c(2L, 1L, 1L, 1L, 0L))) 327s > 327s > ## Check that last commit is a merge 327s > stopifnot(is_merge(last_commit(repo))) 327s > summary(last_commit(repo)) 327s Commit: fce842f698dcd247ff81673580de6d906cb99846 327s Merge: 5d61bfafdf6a974875a967fbd653a651202d1aaa 327s dab777a264208e429c2139b2782567612eb1d265 327s Author: Author 327s When: 2025-03-15 14:47:47 GMT 327s 327s merge fix 327s 327s Commit message: 5d61bfafdf6a974875a967fbd653a651202d1aaa 327s Fourth commit message 327s 327s Commit message: dab777a264208e429c2139b2782567612eb1d265 327s Third commit message 327s 327s > 327s > ## Check that metadata associated with merge is removed 327s > stopifnot(!file.exists(file.path(path, ".git", "MERGE_HEAD"))) 327s > 327s > ## Cleanup 327s > unlink(path, recursive = TRUE) 327s > 327s BEGIN TEST note.R 327s 327s R version 4.4.3 (2025-02-28) -- "Trophy Case" 327s Copyright (C) 2025 The R Foundation for Statistical Computing 327s Platform: aarch64-unknown-linux-gnu 327s 327s R is free software and comes with ABSOLUTELY NO WARRANTY. 327s You are welcome to redistribute it under certain conditions. 327s Type 'license()' or 'licence()' for distribution details. 327s 327s R is a collaborative project with many contributors. 327s Type 'contributors()' for more information and 327s 'citation()' on how to cite R or R packages in publications. 327s 327s Type 'demo()' for some demos, 'help()' for on-line help, or 327s 'help.start()' for an HTML browser interface to help. 327s Type 'q()' to quit R. 327s 327s > ## git2r, R bindings to the libgit2 library. 327s > ## Copyright (C) 2013-2023 The git2r contributors 327s > ## 327s > ## This program is free software; you can redistribute it and/or modify 327s > ## it under the terms of the GNU General Public License, version 2, 327s > ## as published by the Free Software Foundation. 327s > ## 327s > ## git2r is distributed in the hope that it will be useful, 327s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 327s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 327s > ## GNU General Public License for more details. 327s > ## 327s > ## You should have received a copy of the GNU General Public License along 327s > ## with this program; if not, write to the Free Software Foundation, Inc., 327s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 327s > 327s > library("git2r") 327s > 327s > ## For debugging 327s > sessionInfo() 327s R version 4.4.3 (2025-02-28) 327s Platform: aarch64-unknown-linux-gnu 327s Running under: Ubuntu Plucky Puffin (development branch) 327s 327s Matrix products: default 327s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 327s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 327s 327s locale: 327s [1] C 327s 327s time zone: Etc/UTC 327s tzcode source: system (glibc) 327s 327s attached base packages: 327s [1] stats graphics grDevices utils datasets methods base 327s 327s other attached packages: 327s [1] git2r_0.35.0 327s 327s loaded via a namespace (and not attached): 327s [1] compiler_4.4.3 327s > libgit2_version() 327s $major 327s [1] 1 327s 327s $minor 327s [1] 9 327s 327s $rev 327s [1] 0 327s 327s > libgit2_features() 327s $threads 327s [1] TRUE 327s 327s $https 327s [1] TRUE 327s 327s $ssh 327s [1] TRUE 327s 327s > 327s > 327s > ## Create a directory in tempdir 327s > path <- tempfile(pattern = "git2r-") 327s > dir.create(path) 327s > 327s > ## Initialize a repository 327s > repo <- init(path) 327s > config(repo, user.name = "Alice", user.email = "alice@example.org") 327s > 327s > ## Create a file, add and commit 327s > writeLines("Hello world!", file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit_1 <- commit(repo, "Commit message 1") 327s > 327s > ## Create another commit 327s > writeLines(c("Hello world!", 327s + "HELLO WORLD!"), 327s + file.path(path, "test.txt")) 327s > add(repo, "test.txt") 327s > commit_2 <- commit(repo, "Commit message 2") 327s > 327s > ## Check default ref 327s > stopifnot(identical(note_default_ref(repo), 327s + "refs/notes/commits")) 327s > 327s > ## Check that an invalid object argument in note_create produce an 327s > ## error. 327s > tools::assertError(note_create(object = NULL, message = "test")) 327s > tools::assertError(note_create(object = 1, message = "test")) 327s > 327s > ## Check that notes is an empty list 327s > stopifnot(identical(notes(repo), list())) 327s > 327s > ## Create note in default namespace 327s > note_1 <- note_create(commit_1, "Note-1") 327s > stopifnot(identical(print(note_1), note_1)) 327s note: a801dfb10a85d13bc8ab304a9255b5cf180f94dd 327s > stopifnot(identical(length(notes(repo)), 1L)) 327s > stopifnot(identical(sha(note_1), note_1$sha)) 327s > tools::assertError(note_create(commit_1, "Note-2")) 327s > note_2 <- note_create(commit_1, "Note-2", force = TRUE) 327s > stopifnot(identical(length(notes(repo)), 1L)) 327s > 327s > ## Check that an invalid note argument in note_remove produce an 327s > ## error. 327s > tools::assertError(note_remove(note = 1)) 327s > 327s > ## Create note in named (review) namespace 327s > note_3 <- note_create(commit_1, "Note-3", ref = "refs/notes/review") 327s > note_4 <- note_create(commit_2, "Note-4", ref = "refs/notes/review") 327s > stopifnot(identical(length(notes(repo, ref = "refs/notes/review")), 2L)) 327s > note_remove(note_3) 327s > note_remove(note_4) 327s > stopifnot(identical(notes(repo, ref = "refs/notes/review"), list())) 327s > note_5 <- note_create(commit_1, "Note-5", ref = "review") 327s > note_6 <- note_create(commit_2, "Note-6", ref = "review") 327s > stopifnot(identical(length(notes(repo, ref = "review")), 2L)) 327s > note_remove(note_5) 327s > note_remove(note_6) 327s > stopifnot(identical(length(notes(repo, ref = "review")), 0L)) 327s > 327s > ## Create note on blob and tree 327s > tree_1 <- tree(commit_1) 327s > note_7 <- note_create(tree_1, "Note-7") 327s > stopifnot(is(object = lookup(repo, note_7$annotated), class2 = "git_tree")) 327s > stopifnot(identical(length(notes(repo)), 2L)) 327s > blob_1 <- lookup(repo, tree_1$id[1]) 327s > note_8 <- note_create(blob_1, "Note-8") 327s > stopifnot(is(object = lookup(repo, note_8$annotated), class2 = "git_blob")) 327s > stopifnot(identical(length(notes(repo)), 3L)) 327s > 327s > ## Cleanup 327s > unlink(path, recursive = TRUE) 327s > 327s BEGIN TEST odb_blobs.R 328s 328s R version 4.4.3 (2025-02-28) -- "Trophy Case" 328s Copyright (C) 2025 The R Foundation for Statistical Computing 328s Platform: aarch64-unknown-linux-gnu 328s 328s R is free software and comes with ABSOLUTELY NO WARRANTY. 328s You are welcome to redistribute it under certain conditions. 328s Type 'license()' or 'licence()' for distribution details. 328s 328s R is a collaborative project with many contributors. 328s Type 'contributors()' for more information and 328s 'citation()' on how to cite R or R packages in publications. 328s 328s Type 'demo()' for some demos, 'help()' for on-line help, or 328s 'help.start()' for an HTML browser interface to help. 328s Type 'q()' to quit R. 328s 328s > ## git2r, R bindings to the libgit2 library. 328s > ## Copyright (C) 2013-2023 The git2r contributors 328s > ## 328s > ## This program is free software; you can redistribute it and/or modify 328s > ## it under the terms of the GNU General Public License, version 2, 328s > ## as published by the Free Software Foundation. 328s > ## 328s > ## git2r is distributed in the hope that it will be useful, 328s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 328s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 328s > ## GNU General Public License for more details. 328s > ## 328s > ## You should have received a copy of the GNU General Public License along 328s > ## with this program; if not, write to the Free Software Foundation, Inc., 328s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 328s > 328s > library("git2r") 328s > 328s > ## For debugging 328s > sessionInfo() 328s R version 4.4.3 (2025-02-28) 328s Platform: aarch64-unknown-linux-gnu 328s Running under: Ubuntu Plucky Puffin (development branch) 328s 328s Matrix products: default 328s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 328s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 328s 328s locale: 328s [1] C 328s 328s time zone: Etc/UTC 328s tzcode source: system (glibc) 328s 328s attached base packages: 328s [1] stats graphics grDevices utils datasets methods base 328s 328s other attached packages: 328s [1] git2r_0.35.0 328s 328s loaded via a namespace (and not attached): 328s [1] compiler_4.4.3 328s > libgit2_version() 328s $major 328s [1] 1 328s 328s $minor 328s [1] 9 328s 328s $rev 328s [1] 0 328s 328s > libgit2_features() 328s $threads 328s [1] TRUE 328s 328s $https 328s [1] TRUE 328s 328s $ssh 328s [1] TRUE 328s 328s > 328s > 328s > ## Create a directory in tempdir 328s > path <- tempfile(pattern = "git2r-") 328s > dir.create(path) 328s > 328s > ## Initialize a repository 328s > repo <- init(path) 328s > config(repo, user.name = "Alice", user.email = "alice@@example.org") 328s > 328s > ## Create a file, add and commit 328s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 328s + con = file.path(path, "test.txt")) 328s > add(repo, "test.txt") 328s > commit(repo, "Commit message 1") 328s [ddf1550] 2025-03-15: Commit message 1 328s > 328s > ## Change file and commit 328s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 328s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 328s + con = file.path(path, "test.txt")) 328s > add(repo, "test.txt") 328s > commit(repo, "Commit message 2") 328s [4b40286] 2025-03-15: Commit message 2 328s > 328s > ## Commit same content under different name in a sub-directory 328s > dir.create(file.path(path, "sub-directory")) 328s > file.copy(file.path(path, "test.txt"), 328s + file.path(path, "sub-directory", "copy.txt")) 328s [1] TRUE 328s > add(repo, "sub-directory/copy.txt") 328s > commit(repo, "Commit message 3") 328s [c4e8c24] 2025-03-15: Commit message 3 328s > 328s > ## List blobs 328s > b <- odb_blobs(repo) 328s > 328s > ## Order the data.frame before checking 328s > b <- b[order(b$name), ] 328s > 328s > ## Check blobs 328s > stopifnot(identical(nrow(b), 3L)) 328s > stopifnot(identical( 328s + colnames(b), 328s + c("sha", "path", "name", "len", "commit", "author", "when"))) 328s > stopifnot(identical(b$path, c("sub-directory", "", ""))) 328s > stopifnot(identical(b$name, c("copy.txt", "test.txt", "test.txt"))) 328s > stopifnot(identical(b$author, c("Alice", "Alice", "Alice"))) 328s > 328s > ## Cleanup 328s > unlink(path, recursive = TRUE) 328s > 328s BEGIN TEST pre-process-path.R 328s 328s R version 4.4.3 (2025-02-28) -- "Trophy Case" 328s Copyright (C) 2025 The R Foundation for Statistical Computing 328s Platform: aarch64-unknown-linux-gnu 328s 328s R is free software and comes with ABSOLUTELY NO WARRANTY. 328s You are welcome to redistribute it under certain conditions. 328s Type 'license()' or 'licence()' for distribution details. 328s 328s R is a collaborative project with many contributors. 328s Type 'contributors()' for more information and 328s 'citation()' on how to cite R or R packages in publications. 328s 328s Type 'demo()' for some demos, 'help()' for on-line help, or 328s 'help.start()' for an HTML browser interface to help. 328s Type 'q()' to quit R. 328s 328s > ## git2r, R bindings to the libgit2 library. 328s > ## Copyright (C) 2013-2023 The git2r contributors 328s > ## 328s > ## This program is free software; you can redistribute it and/or modify 328s > ## it under the terms of the GNU General Public License, version 2, 328s > ## as published by the Free Software Foundation. 328s > ## 328s > ## git2r is distributed in the hope that it will be useful, 328s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 328s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 328s > ## GNU General Public License for more details. 328s > ## 328s > ## You should have received a copy of the GNU General Public License along 328s > ## with this program; if not, write to the Free Software Foundation, Inc., 328s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 328s > 328s > library(git2r) 328s > source("util/check.R") 328s > 328s > ## For debugging 328s > sessionInfo() 328s R version 4.4.3 (2025-02-28) 328s Platform: aarch64-unknown-linux-gnu 328s Running under: Ubuntu Plucky Puffin (development branch) 328s 328s Matrix products: default 328s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 328s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 328s 328s locale: 328s [1] C 328s 328s time zone: Etc/UTC 328s tzcode source: system (glibc) 328s 328s attached base packages: 328s [1] stats graphics grDevices utils datasets methods base 328s 328s other attached packages: 328s [1] git2r_0.35.0 328s 328s loaded via a namespace (and not attached): 328s [1] compiler_4.4.3 328s > libgit2_version() 328s $major 328s [1] 1 328s 328s $minor 328s [1] 9 328s 328s $rev 328s [1] 0 328s 328s > libgit2_features() 328s $threads 328s [1] TRUE 328s 328s $https 328s [1] TRUE 328s 328s $ssh 328s [1] TRUE 328s 328s > 328s > 328s > ## Create a directory in tempdir 328s > path <- tempfile(pattern = "git2r-") 328s > dir.create(path) 328s > setwd(path) 328s > 328s > ## Initialize a repository 328s > repo <- init(path) 328s > config(repo, user.name = "Alice", user.email = "alice@example.org") 328s > 328s > ## Test to add file with a leading './' 328s > writeLines("foo-1", file.path(path, "foo-1")) 328s > add(repo, "./foo-1") 328s > status_exp <- structure(list(staged = list(new = "foo-1"), 328s + unstaged = empty_named_list(), 328s + untracked = empty_named_list()), 328s + class = "git_status") 328s > status_obs <- status(repo) 328s > str(status_exp) 328s List of 3 328s $ staged :List of 1 328s ..$ new: chr "foo-1" 328s $ unstaged : Named list() 328s $ untracked: Named list() 328s - attr(*, "class")= chr "git_status" 328s > str(status_obs) 328s List of 3 328s $ staged :List of 1 328s ..$ new: chr "foo-1" 328s $ unstaged : Named list() 328s $ untracked: Named list() 328s - attr(*, "class")= chr "git_status" 328s > stopifnot(identical(status_obs, status_exp)) 328s > 328s > ## Test to add file in sub-folder with sub-folder as working directory 328s > writeLines("foo-2", file.path(path, "foo-2")) 328s > dir.create(file.path(path, "foo_dir")) 328s > writeLines("foo-2", file.path(path, "foo_dir/foo-2")) 328s > setwd("./foo_dir") 328s > add(repo, "foo-2") 328s > status_exp <- structure(list(staged = list(new = "foo-1", 328s + new = "foo_dir/foo-2"), 328s + unstaged = empty_named_list(), 328s + untracked = list(untracked = "foo-2")), 328s + class = "git_status") 328s > status_obs <- status(repo) 328s > str(status_exp) 328s List of 3 328s $ staged :List of 2 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > str(status_obs) 328s List of 3 328s $ staged :List of 2 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > stopifnot(identical(status_obs, status_exp)) 328s > 328s > ## Test glob expansion 328s > setwd(tempdir()) 328s > dir.create(file.path(path, "glob_dir")) 328s > writeLines("a", file.path(path, "glob_dir/a.txt")) 328s > writeLines("b", file.path(path, "glob_dir/b.txt")) 328s > writeLines("c", file.path(path, "glob_dir/c.txt")) 328s > writeLines("d", file.path(path, "glob_dir/d.md")) 328s > add(repo, "glob_dir/*txt") 328s > status_exp <- structure(list(staged = list(new = "foo-1", 328s + new = "foo_dir/foo-2", 328s + new = "glob_dir/a.txt", 328s + new = "glob_dir/b.txt", 328s + new = "glob_dir/c.txt"), 328s + unstaged = empty_named_list(), 328s + untracked = list(untracked = "foo-2", 328s + untracked = "glob_dir/d.md")), 328s + class = "git_status") 328s > status_obs <- status(repo) 328s > str(status_exp) 328s List of 3 328s $ staged :List of 5 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s $ unstaged : Named list() 328s $ untracked:List of 2 328s ..$ untracked: chr "foo-2" 328s ..$ untracked: chr "glob_dir/d.md" 328s - attr(*, "class")= chr "git_status" 328s > str(status_obs) 328s List of 3 328s $ staged :List of 5 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s $ unstaged : Named list() 328s $ untracked:List of 2 328s ..$ untracked: chr "foo-2" 328s ..$ untracked: chr "glob_dir/d.md" 328s - attr(*, "class")= chr "git_status" 328s > stopifnot(identical(status_obs, status_exp)) 328s > 328s > ## Test glob expansion with relative path 328s > setwd(path) 328s > add(repo, "./glob_dir/*md") 328s > status_exp <- structure(list(staged = list(new = "foo-1", 328s + new = "foo_dir/foo-2", 328s + new = "glob_dir/a.txt", 328s + new = "glob_dir/b.txt", 328s + new = "glob_dir/c.txt", 328s + new = "glob_dir/d.md"), 328s + unstaged = empty_named_list(), 328s + untracked = list(untracked = "foo-2")), 328s + class = "git_status") 328s > status_obs <- status(repo) 328s > str(status_exp) 328s List of 3 328s $ staged :List of 6 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s ..$ new: chr "glob_dir/d.md" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > str(status_obs) 328s List of 3 328s $ staged :List of 6 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s ..$ new: chr "glob_dir/d.md" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > stopifnot(identical(status_obs, status_exp)) 328s > 328s > ## Test to add file in root of workdir when the file also exists in 328s > ## current workdir. 328s > setwd(tempdir()) 328s > writeLines("e", file.path(path, "e.txt")) 328s > writeLines("e", file.path(tempdir(), "e.txt")) 328s > add(repo, "e.txt") 328s > status_exp <- structure(list(staged = list(new = "e.txt", 328s + new = "foo-1", 328s + new = "foo_dir/foo-2", 328s + new = "glob_dir/a.txt", 328s + new = "glob_dir/b.txt", 328s + new = "glob_dir/c.txt", 328s + new = "glob_dir/d.md"), 328s + unstaged = empty_named_list(), 328s + untracked = list(untracked = "foo-2")), 328s + class = "git_status") 328s > status_obs <- status(repo) 328s > str(status_exp) 328s List of 3 328s $ staged :List of 7 328s ..$ new: chr "e.txt" 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s ..$ new: chr "glob_dir/d.md" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > str(status_obs) 328s List of 3 328s $ staged :List of 7 328s ..$ new: chr "e.txt" 328s ..$ new: chr "foo-1" 328s ..$ new: chr "foo_dir/foo-2" 328s ..$ new: chr "glob_dir/a.txt" 328s ..$ new: chr "glob_dir/b.txt" 328s ..$ new: chr "glob_dir/c.txt" 328s ..$ new: chr "glob_dir/d.md" 328s $ unstaged : Named list() 328s $ untracked:List of 1 328s ..$ untracked: chr "foo-2" 328s - attr(*, "class")= chr "git_status" 328s > stopifnot(identical(status_obs, status_exp)) 328s > 328s > ## Cleanup 328s > unlink(path, recursive = TRUE) 328s > 328s BEGIN TEST pull.R 328s 328s R version 4.4.3 (2025-02-28) -- "Trophy Case" 328s Copyright (C) 2025 The R Foundation for Statistical Computing 328s Platform: aarch64-unknown-linux-gnu 328s 328s R is free software and comes with ABSOLUTELY NO WARRANTY. 328s You are welcome to redistribute it under certain conditions. 328s Type 'license()' or 'licence()' for distribution details. 328s 328s R is a collaborative project with many contributors. 328s Type 'contributors()' for more information and 328s 'citation()' on how to cite R or R packages in publications. 328s 328s Type 'demo()' for some demos, 'help()' for on-line help, or 328s 'help.start()' for an HTML browser interface to help. 328s Type 'q()' to quit R. 328s 328s > ## git2r, R bindings to the libgit2 library. 328s > ## Copyright (C) 2013-2023 The git2r contributors 328s > ## 328s > ## This program is free software; you can redistribute it and/or modify 328s > ## it under the terms of the GNU General Public License, version 2, 328s > ## as published by the Free Software Foundation. 328s > ## 328s > ## git2r is distributed in the hope that it will be useful, 328s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 328s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 328s > ## GNU General Public License for more details. 328s > ## 328s > ## You should have received a copy of the GNU General Public License along 328s > ## with this program; if not, write to the Free Software Foundation, Inc., 328s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 328s > 328s > library(git2r) 328s > 328s > ## For debugging 328s > sessionInfo() 328s R version 4.4.3 (2025-02-28) 328s Platform: aarch64-unknown-linux-gnu 328s Running under: Ubuntu Plucky Puffin (development branch) 328s 328s Matrix products: default 328s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 328s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 328s 328s locale: 328s [1] C 328s 328s time zone: Etc/UTC 328s tzcode source: system (glibc) 328s 328s attached base packages: 328s [1] stats graphics grDevices utils datasets methods base 328s 328s other attached packages: 328s [1] git2r_0.35.0 328s 328s loaded via a namespace (and not attached): 328s [1] compiler_4.4.3 328s > libgit2_version() 328s $major 328s [1] 1 328s 328s $minor 328s [1] 9 328s 328s $rev 328s [1] 0 328s 328s > libgit2_features() 328s $threads 328s [1] TRUE 328s 328s $https 328s [1] TRUE 328s 328s $ssh 328s [1] TRUE 328s 328s > 328s > 328s > ## Create directories for repositories in tempdir 328s > path_bare <- tempfile(pattern = "git2r-") 328s > path_repo_1 <- tempfile(pattern = "git2r-") 328s > path_repo_2 <- tempfile(pattern = "git2r-") 328s > 328s > dir.create(path_bare) 328s > dir.create(path_repo_1) 328s > dir.create(path_repo_2) 328s > 328s > ## Create bare repository 328s > bare_repo <- init(path_bare, bare = TRUE) 328s > 328s > ## Clone to repo 1 328s > repo_1 <- clone(path_bare, path_repo_1) 328s cloning into '/tmp/RtmpFZNZKc/git2r-a444a536112'... 328s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 328s > 328s > ## Add changes to repo 1 and push to bare 328s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 328s + con = file.path(path_repo_1, "test-1.txt")) 328s > add(repo_1, "test-1.txt") 328s > commit_1 <- commit(repo_1, "First commit message") 328s > branch_name <- branches(repo_1)[[1]]$name 328s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 328s > 328s > ## Clone to repo 2 328s > repo_2 <- clone(path_bare, path_repo_2) 328s cloning into '/tmp/RtmpFZNZKc/git2r-a4472fb8628'... 328s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 328s > 328s > ## Add more changes to repo 1 and push to bare 328s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 328s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 328s + con = file.path(path_repo_1, "test-1.txt")) 328s > add(repo_1, "test-1.txt") 328s > commit_2 <- commit(repo_1, "Second commit message") 328s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 328s > 328s > ## Pull changes to repo_2 328s > pull(repo_2) 328s [updated] cca3964f7b..7846f16eb7 refs/remotes/origin/master 328s Merge: Fast-forward 328s > stopifnot(identical(length(commits(repo_2)), 2L)) 328s > 328s > ## Check remote url of repo_2 328s > stopifnot(identical( 328s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 328s + path_bare)) 328s > 328s > ## Unset remote remote tracking branch 328s > branch_set_upstream(repository_head(repo_2), NULL) 328s > stopifnot(is.null(branch_get_upstream(repository_head(repo_2)))) 328s > tools::assertError(pull(repo_2)) 328s > tools::assertError(branch_set_upstream(repository_head(repo_2), NULL)) 328s > 328s > ## Add more changes to repo 1 and push to bare 328s > writeLines( 328s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 328s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 328s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 328s + con = file.path(path_repo_1, "test-1.txt")) 328s > add(repo_1, "test-1.txt") 328s > commit_3 <- commit(repo_1, "Third commit message") 328s > push(repo_1) 328s > 328s > ## Set remote tracking branch 328s > branch_set_upstream(repository_head(repo_2), 328s + paste0("origin/", branch_name)) 328s > stopifnot(identical( 328s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 328s + path_bare)) 328s > 328s > ## Pull changes to repo_2 328s > pull(repo_2) 328s [updated] 7846f16eb7..aab8fd9db1 refs/remotes/origin/master 328s Merge: Fast-forward 328s > stopifnot(identical(length(commits(repo_2)), 3L)) 328s > 328s > ## Check references in repo_1 and repo_2. Must clear the repo item 328s > ## since the repositories have different paths. 328s > stopifnot(identical(length(references(repo_1)), 2L)) 328s > 328s > ref_1 <- references(repo_1) 328s > lapply(seq_len(length(ref_1)), function(i) { 328s + ref_1[[i]]$repo <<- NULL 328s + }) 328s [[1]] 328s NULL 328s 328s [[2]] 328s NULL 328s 328s > 328s > ref_2 <- references(repo_2) 328s > lapply(seq_len(length(ref_2)), function(i) { 328s + ref_2[[i]]$repo <<- NULL 328s + }) 328s [[1]] 328s NULL 328s 328s [[2]] 328s NULL 328s 328s [[3]] 328s NULL 328s 328s > 328s > name <- paste0("refs/heads/", branch_name) 328s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 328s > 328s > name <- paste0("refs/remotes/", branch_name) 328s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 328s > 328s > ref_1 <- references(repo_1)[[paste0("refs/heads/", branch_name)]] 328s > stopifnot(identical(ref_1$name, paste0("refs/heads/", branch_name))) 328s > stopifnot(identical(ref_1$type, 1L)) 328s > stopifnot(identical(sha(ref_1), sha(commit_3))) 328s > stopifnot(identical(ref_1$target, NA_character_)) 328s > stopifnot(identical(ref_1$shorthand, branch_name)) 328s > 328s > ref_2 <- references(repo_1)[[paste0("refs/remotes/origin/", branch_name)]] 328s > stopifnot(identical(ref_2$name, paste0("refs/remotes/origin/", branch_name))) 328s > stopifnot(identical(ref_2$type, 1L)) 328s > stopifnot(identical(sha(ref_2), sha(commit_3))) 328s > stopifnot(identical(ref_2$target, NA_character_)) 328s > stopifnot(identical(ref_2$shorthand, paste0("origin/", branch_name))) 328s > 328s > ## Check references with missing repo argument 328s > wd <- setwd(path_repo_1) 328s > stopifnot(identical(length(references()), 2L)) 328s > if (!is.null(wd)) 328s + setwd(wd) 328s > 328s > ## Cleanup 328s > unlink(path_bare, recursive = TRUE) 328s > unlink(path_repo_1, recursive = TRUE) 328s > unlink(path_repo_2, recursive = TRUE) 328s > 328s BEGIN TEST push-force.R 328s 328s R version 4.4.3 (2025-02-28) -- "Trophy Case" 328s Copyright (C) 2025 The R Foundation for Statistical Computing 328s Platform: aarch64-unknown-linux-gnu 328s 328s R is free software and comes with ABSOLUTELY NO WARRANTY. 328s You are welcome to redistribute it under certain conditions. 328s Type 'license()' or 'licence()' for distribution details. 328s 328s R is a collaborative project with many contributors. 328s Type 'contributors()' for more information and 328s 'citation()' on how to cite R or R packages in publications. 328s 328s Type 'demo()' for some demos, 'help()' for on-line help, or 328s 'help.start()' for an HTML browser interface to help. 328s Type 'q()' to quit R. 328s 329s > ## git2r, R bindings to the libgit2 library. 329s > ## Copyright (C) 2013-2023 The git2r contributors 329s > ## 329s > ## This program is free software; you can redistribute it and/or modify 329s > ## it under the terms of the GNU General Public License, version 2, 329s > ## as published by the Free Software Foundation. 329s > ## 329s > ## git2r is distributed in the hope that it will be useful, 329s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 329s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 329s > ## GNU General Public License for more details. 329s > ## 329s > ## You should have received a copy of the GNU General Public License along 329s > ## with this program; if not, write to the Free Software Foundation, Inc., 329s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 329s > 329s > library(git2r) 329s > 329s > ## For debugging 329s > sessionInfo() 329s R version 4.4.3 (2025-02-28) 329s Platform: aarch64-unknown-linux-gnu 329s Running under: Ubuntu Plucky Puffin (development branch) 329s 329s Matrix products: default 329s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 329s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 329s 329s locale: 329s [1] C 329s 329s time zone: Etc/UTC 329s tzcode source: system (glibc) 329s 329s attached base packages: 329s [1] stats graphics grDevices utils datasets methods base 329s 329s other attached packages: 329s [1] git2r_0.35.0 329s 329s loaded via a namespace (and not attached): 329s [1] compiler_4.4.3 329s > libgit2_version() 329s $major 329s [1] 1 329s 329s $minor 329s [1] 9 329s 329s $rev 329s [1] 0 329s 329s > libgit2_features() 329s $threads 329s [1] TRUE 329s 329s $https 329s [1] TRUE 329s 329s $ssh 329s [1] TRUE 329s 329s > 329s > 329s > ## Create directories for repositories in tempdir 329s > path_bare <- tempfile(pattern = "git2r-") 329s > path_repo_1 <- tempfile(pattern = "git2r-") 329s > path_repo_2 <- tempfile(pattern = "git2r-") 329s > 329s > dir.create(path_bare) 329s > dir.create(path_repo_1) 329s > dir.create(path_repo_2) 329s > 329s > ## Create bare repository 329s > bare_repo <- init(path_bare, bare = TRUE) 329s > 329s > ## Clone to repo 1 329s > repo_1 <- clone(path_bare, path_repo_1) 329s cloning into '/tmp/RtmpkMo2tX/git2r-a521fcb2b53'... 329s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 329s > 329s > ## Add changes to repo 1 and push to bare 329s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 329s + con = file.path(path_repo_1, "test-1.txt")) 329s > add(repo_1, "test-1.txt") 329s > commit_1 <- commit(repo_1, "First commit message") 329s > branch_name <- branches(repo_1)[[1]]$name 329s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 329s > 329s > ## Clone to repo 2 329s > repo_2 <- clone(path_bare, path_repo_2) 329s cloning into '/tmp/RtmpkMo2tX/git2r-a521c0bddac'... 329s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 329s > 329s > ## Add more changes to repo 1 and push to bare 329s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 329s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 329s + con = file.path(path_repo_1, "test-1.txt")) 329s > add(repo_1, "test-1.txt") 329s > commit_2 <- commit(repo_1, "Second commit message") 329s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 329s > 329s > ## Add changes to repo 2 and push to bare 329s > writeLines( 329s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 329s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 329s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 329s + con = file.path(path_repo_2, "test-1.txt")) 329s > add(repo_2, "test-1.txt") 329s > commit_3 <- commit(repo_2, "Third commit message") 329s > 329s > ## We are behind, so this should fail 329s > tools::assertError(push(repo_2)) 329s > 329s > ## Push with force = TRUE 329s > push(repo_2, force = TRUE) 329s > 329s > ## Check commits 329s > stopifnot(identical(length(commits(bare_repo)), 2L)) 329s > stopifnot(identical(sha(commits(repo_2)[[1]]), sha(commits(bare_repo)[[1]]))) 329s > stopifnot(identical(sha(commits(repo_2)[[2]]), sha(commits(bare_repo)[[2]]))) 329s > 329s > ## Cleanup 329s > unlink(path_bare, recursive = TRUE) 329s > unlink(path_repo_1, recursive = TRUE) 329s > unlink(path_repo_2, recursive = TRUE) 329s > 329s BEGIN TEST push.R 329s 329s R version 4.4.3 (2025-02-28) -- "Trophy Case" 329s Copyright (C) 2025 The R Foundation for Statistical Computing 329s Platform: aarch64-unknown-linux-gnu 329s 329s R is free software and comes with ABSOLUTELY NO WARRANTY. 329s You are welcome to redistribute it under certain conditions. 329s Type 'license()' or 'licence()' for distribution details. 329s 329s R is a collaborative project with many contributors. 329s Type 'contributors()' for more information and 329s 'citation()' on how to cite R or R packages in publications. 329s 329s Type 'demo()' for some demos, 'help()' for on-line help, or 329s 'help.start()' for an HTML browser interface to help. 329s Type 'q()' to quit R. 329s 329s > ## git2r, R bindings to the libgit2 library. 329s > ## Copyright (C) 2013-2023 The git2r contributors 329s > ## 329s > ## This program is free software; you can redistribute it and/or modify 329s > ## it under the terms of the GNU General Public License, version 2, 329s > ## as published by the Free Software Foundation. 329s > ## 329s > ## git2r is distributed in the hope that it will be useful, 329s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 329s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 329s > ## GNU General Public License for more details. 329s > ## 329s > ## You should have received a copy of the GNU General Public License along 329s > ## with this program; if not, write to the Free Software Foundation, Inc., 329s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 329s > 329s > library(git2r) 329s > 329s > ## For debugging 329s > sessionInfo() 329s R version 4.4.3 (2025-02-28) 329s Platform: aarch64-unknown-linux-gnu 329s Running under: Ubuntu Plucky Puffin (development branch) 329s 329s Matrix products: default 329s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 329s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 329s 329s locale: 329s [1] C 329s 329s time zone: Etc/UTC 329s tzcode source: system (glibc) 329s 329s attached base packages: 329s [1] stats graphics grDevices utils datasets methods base 329s 329s other attached packages: 329s [1] git2r_0.35.0 329s 329s loaded via a namespace (and not attached): 329s [1] compiler_4.4.3 329s > libgit2_version() 329s $major 329s [1] 1 329s 329s $minor 329s [1] 9 329s 329s $rev 329s [1] 0 329s 329s > libgit2_features() 329s $threads 329s [1] TRUE 329s 329s $https 329s [1] TRUE 329s 329s $ssh 329s [1] TRUE 329s 329s > 329s > 329s > ## Create 2 directories in tempdir 329s > path_bare <- tempfile(pattern = "git2r-") 329s > path_repo <- tempfile(pattern = "git2r-") 329s > 329s > dir.create(path_bare) 329s > dir.create(path_repo) 329s > 329s > ## Create repositories 329s > bare_repo <- init(path_bare, bare = TRUE) 329s > repo <- clone(path_bare, path_repo) 329s cloning into '/tmp/RtmpqcznO4/git2r-a5e3d556714'... 329s > 329s > ## Check the repositores 329s > stopifnot(identical(is_bare(bare_repo), TRUE)) 329s > stopifnot(identical(is_bare(repo), FALSE)) 329s > 329s > ## Config repositories 329s > config(repo, user.name = "Alice", user.email = "alice@example.org") 329s > 329s > ## Add changes to repo 329s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 329s > add(repo, "test.txt") 329s > commit_1 <- commit(repo, "Commit message") 329s > branch_name <- branches(repo)[[1]]$name 329s > 329s > ## Check commit 329s > stopifnot(identical(commit_1$author$name, "Alice")) 329s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 329s > stopifnot(identical(length(commits(repo)), 1L)) 329s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 329s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 329s > 329s > ## Check push arguments 329s > tools::assertError(push(repo, character(0), paste0("refs/heads/", branch_name))) 329s > tools::assertError(push(repo, NA_character_, paste0("refs/heads/", branch_name))) 329s > tools::assertError(push(repo, c("origin", "origin"), paste0("refs/heads/", branch_name))) 329s > tools::assertError(push(repo, "origin")) 329s > tools::assertError(push(repo, name = "origin")) 329s > push(repo, "origin", character(0)) 329s > push(repo, "origin", NA_character_) 329s > push(repo, "origin", c(NA_character_, NA_character_)) 329s > stopifnot(identical(reflog(repo, paste0("refs/remotes/origin/", branch_name)), 329s + structure(list(), class = "git_reflog"))) 329s > 329s > ## No tracking branch assigned to master 329s > tools::assertError(push(branches(repo)[[1]])) 329s > 329s > ## Push changes from repo to origin 329s > push(repo, "origin", paste0("refs/heads/", branch_name)) 329s > r <- reflog(repo, paste0("refs/remotes/origin/", branch_name)) 329s > stopifnot(identical(length(r), 1L)) 329s > r <- r[[1]] 329s > stopifnot(identical(sha(r), sha(commit_1))) 329s > stopifnot(identical(r$message, "update by push")) 329s > stopifnot(identical(r$index, 0L)) 329s > stopifnot(identical(r$committer$name, "Alice")) 329s > stopifnot(identical(r$committer$email, "alice@example.org")) 329s > stopifnot(identical(r$refname, paste0("refs/remotes/origin/", branch_name))) 329s > stopifnot(identical(r$repo$path, repo$path)) 329s > push(branches(repo)[[1]]) 329s > 329s > ## Check result in bare repository 329s > stopifnot(identical(length(commits(bare_repo)), 1L)) 329s > bare_commit_1 <- commits(bare_repo)[[1]] 329s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 329s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 329s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 329s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 329s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 329s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 329s > 329s > ## Add changes to repo and push head 329s > writeLines(c("Hello world", "HELLO WORLD"), 329s + con = file.path(path_repo, "test.txt")) 329s > add(repo, "test.txt") 329s > commit_2 <- commit(repo, "Commit message 2") 329s > push(repo) 329s > bare_commit_2 <- lookup(bare_repo, sha(commit_2)) 329s > stopifnot(identical(sha(commit_2), sha(bare_commit_2))) 329s > stopifnot(identical(commit_2$author, bare_commit_2$author)) 329s > stopifnot(identical(commit_2$committer, bare_commit_2$committer)) 329s > stopifnot(identical(commit_2$summary, bare_commit_2$summary)) 329s > stopifnot(identical(commit_2$message, bare_commit_2$message)) 329s > stopifnot(!identical(commit_2$repo, bare_commit_2$repo)) 329s > 329s > ## Check 'set_upstream' 329s > branch_set_upstream(repository_head(repo), NULL) 329s > push(repo, "origin", paste0("refs/heads/", branch_name)) 329s > stopifnot(is.null(branch_get_upstream(repository_head(repo)))) 329s > push(repo, "origin", paste0("refs/heads/", branch_name), set_upstream = TRUE) 329s > stopifnot(!is.null(branch_get_upstream(repository_head(repo)))) 329s > 329s > ## Cleanup 329s > unlink(path_bare, recursive = TRUE) 329s > unlink(path_repo, recursive = TRUE) 329s > 329s BEGIN TEST reference.R 329s 329s R version 4.4.3 (2025-02-28) -- "Trophy Case" 329s Copyright (C) 2025 The R Foundation for Statistical Computing 329s Platform: aarch64-unknown-linux-gnu 329s 329s R is free software and comes with ABSOLUTELY NO WARRANTY. 329s You are welcome to redistribute it under certain conditions. 329s Type 'license()' or 'licence()' for distribution details. 329s 329s R is a collaborative project with many contributors. 329s Type 'contributors()' for more information and 329s 'citation()' on how to cite R or R packages in publications. 329s 329s Type 'demo()' for some demos, 'help()' for on-line help, or 329s 'help.start()' for an HTML browser interface to help. 329s Type 'q()' to quit R. 329s 329s > ## git2r, R bindings to the libgit2 library. 329s > ## Copyright (C) 2013-2023 The git2r contributors 329s > ## 329s > ## This program is free software; you can redistribute it and/or modify 329s > ## it under the terms of the GNU General Public License, version 2, 329s > ## as published by the Free Software Foundation. 329s > ## 329s > ## git2r is distributed in the hope that it will be useful, 329s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 329s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 329s > ## GNU General Public License for more details. 329s > ## 329s > ## You should have received a copy of the GNU General Public License along 329s > ## with this program; if not, write to the Free Software Foundation, Inc., 329s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 329s > 329s > library(git2r) 329s > 329s > ## For debugging 329s > sessionInfo() 329s R version 4.4.3 (2025-02-28) 329s Platform: aarch64-unknown-linux-gnu 329s Running under: Ubuntu Plucky Puffin (development branch) 329s 329s Matrix products: default 329s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 329s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 329s 329s locale: 329s [1] C 329s 329s time zone: Etc/UTC 329s tzcode source: system (glibc) 329s 329s attached base packages: 329s [1] stats graphics grDevices utils datasets methods base 329s 329s other attached packages: 329s [1] git2r_0.35.0 329s 329s loaded via a namespace (and not attached): 329s [1] compiler_4.4.3 329s > libgit2_version() 329s $major 329s [1] 1 329s 329s $minor 329s [1] 9 329s 329s $rev 329s [1] 0 329s 329s > libgit2_features() 329s $threads 329s [1] TRUE 329s 329s $https 329s [1] TRUE 329s 329s $ssh 329s [1] TRUE 329s 329s > 329s > 329s > ## Create a directory in tempdir 329s > path <- tempfile(pattern = "git2r-") 329s > dir.create(path) 329s > 329s > ## Initialize a repository 329s > repo <- init(path, branch = "main") 329s > config(repo, user.name = "Alice", user.email = "alice@example.org") 329s > 329s > ## Create a file 329s > writeLines("Hello world!", file.path(path, "test.txt")) 329s > 329s > ## add and commit 329s > add(repo, "test.txt") 329s > commit(repo, "Commit message") 329s [aee4186] 2025-03-15: Commit message 329s > 329s > ## Check dwim of reference shorthand 329s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "")$name, 329s + "refs/heads/main")) 329s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "main")$name, 329s + "refs/heads/main")) 329s > stopifnot(identical( 329s + .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main")$name, 329s + "refs/heads/main")) 329s > 329s > ## print reference 329s > r <- .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main") 329s > stopifnot(identical(print(r), r)) 329s [aee418] main 329s > 329s > ## Cleanup 329s > unlink(path, recursive = TRUE) 329s > 329s BEGIN TEST reflog.R 329s 329s R version 4.4.3 (2025-02-28) -- "Trophy Case" 329s Copyright (C) 2025 The R Foundation for Statistical Computing 329s Platform: aarch64-unknown-linux-gnu 329s 329s R is free software and comes with ABSOLUTELY NO WARRANTY. 329s You are welcome to redistribute it under certain conditions. 329s Type 'license()' or 'licence()' for distribution details. 329s 329s R is a collaborative project with many contributors. 329s Type 'contributors()' for more information and 329s 'citation()' on how to cite R or R packages in publications. 329s 329s Type 'demo()' for some demos, 'help()' for on-line help, or 329s 'help.start()' for an HTML browser interface to help. 329s Type 'q()' to quit R. 329s 329s > ## git2r, R bindings to the libgit2 library. 329s > ## Copyright (C) 2013-2023 The git2r contributors 329s > ## 329s > ## This program is free software; you can redistribute it and/or modify 329s > ## it under the terms of the GNU General Public License, version 2, 329s > ## as published by the Free Software Foundation. 329s > ## 329s > ## git2r is distributed in the hope that it will be useful, 329s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 329s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 329s > ## GNU General Public License for more details. 329s > ## 329s > ## You should have received a copy of the GNU General Public License along 329s > ## with this program; if not, write to the Free Software Foundation, Inc., 329s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 329s > 329s > library("git2r") 329s > 329s > ## For debugging 329s > sessionInfo() 329s R version 4.4.3 (2025-02-28) 329s Platform: aarch64-unknown-linux-gnu 329s Running under: Ubuntu Plucky Puffin (development branch) 329s 329s Matrix products: default 329s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 329s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 329s 329s locale: 329s [1] C 329s 329s time zone: Etc/UTC 329s tzcode source: system (glibc) 329s 329s attached base packages: 329s [1] stats graphics grDevices utils datasets methods base 329s 329s other attached packages: 329s [1] git2r_0.35.0 329s 329s loaded via a namespace (and not attached): 329s [1] compiler_4.4.3 329s > libgit2_version() 329s $major 329s [1] 1 329s 329s $minor 329s [1] 9 329s 329s $rev 329s [1] 0 329s 329s > libgit2_features() 329s $threads 329s [1] TRUE 329s 329s $https 329s [1] TRUE 329s 329s $ssh 329s [1] TRUE 329s 329s > 329s > 329s > ## Create a directory in tempdir 329s > path <- tempfile(pattern = "git2r-") 329s > dir.create(path) 329s > 329s > ## Initialize a repository 329s > repo <- init(path) 329s > config(repo, user.name = "Alice", user.email = "alice@example.org") 329s > 329s > ## Check that reflog is empty 329s > stopifnot(identical(reflog(repo), structure(list(), class = "git_reflog"))) 329s > 329s > ## Create a file 329s > writeLines("Hello world!", file.path(path, "test.txt")) 329s > 329s > ## add and commit 329s > add(repo, "test.txt") 329s > commit_1 <- commit(repo, "Commit message") 329s > 329s > ## Check that reflog is not empry 329s > stopifnot(identical(length(reflog(repo)), 1L)) 329s > reflog_entry <- reflog(repo)[[1]] 329s > stopifnot(identical(sha(reflog_entry), sha(commit_1))) 329s > stopifnot(identical(reflog_entry$refname, "HEAD")) 329s > stopifnot(identical(reflog_entry$index, 0L)) 329s > stopifnot(identical(reflog_entry$committer$email, "alice@example.org")) 329s > stopifnot(identical(reflog_entry$message, "commit (initial): Commit message")) 329s > 329s > ## Check printing 329s > r <- reflog(repo) 329s > stopifnot(identical(print(r), r)) 329s [aee4186] HEAD@{0}: commit (initial): Commit message 329s > 329s > ## Cleanup 329s > unlink(path, recursive = TRUE) 329s > 329s BEGIN TEST refspec.R 330s 330s R version 4.4.3 (2025-02-28) -- "Trophy Case" 330s Copyright (C) 2025 The R Foundation for Statistical Computing 330s Platform: aarch64-unknown-linux-gnu 330s 330s R is free software and comes with ABSOLUTELY NO WARRANTY. 330s You are welcome to redistribute it under certain conditions. 330s Type 'license()' or 'licence()' for distribution details. 330s 330s R is a collaborative project with many contributors. 330s Type 'contributors()' for more information and 330s 'citation()' on how to cite R or R packages in publications. 330s 330s Type 'demo()' for some demos, 'help()' for on-line help, or 330s 'help.start()' for an HTML browser interface to help. 330s Type 'q()' to quit R. 330s 330s > ## git2r, R bindings to the libgit2 library. 330s > ## Copyright (C) 2013-2023 The git2r contributors 330s > ## 330s > ## This program is free software; you can redistribute it and/or modify 330s > ## it under the terms of the GNU General Public License, version 2, 330s > ## as published by the Free Software Foundation. 330s > ## 330s > ## git2r is distributed in the hope that it will be useful, 330s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 330s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 330s > ## GNU General Public License for more details. 330s > ## 330s > ## You should have received a copy of the GNU General Public License along 330s > ## with this program; if not, write to the Free Software Foundation, Inc., 330s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 330s > 330s > library("git2r") 330s > 330s > ## For debugging 330s > sessionInfo() 330s R version 4.4.3 (2025-02-28) 330s Platform: aarch64-unknown-linux-gnu 330s Running under: Ubuntu Plucky Puffin (development branch) 330s 330s Matrix products: default 330s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 330s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 330s 330s locale: 330s [1] C 330s 330s time zone: Etc/UTC 330s tzcode source: system (glibc) 330s 330s attached base packages: 330s [1] stats graphics grDevices utils datasets methods base 330s 330s other attached packages: 330s [1] git2r_0.35.0 330s 330s loaded via a namespace (and not attached): 330s [1] compiler_4.4.3 330s > libgit2_version() 330s $major 330s [1] 1 330s 330s $minor 330s [1] 9 330s 330s $rev 330s [1] 0 330s 330s > libgit2_features() 330s $threads 330s [1] TRUE 330s 330s $https 330s [1] TRUE 330s 330s $ssh 330s [1] TRUE 330s 330s > 330s > 330s > ## Create directories for repositories in tempdir 330s > path_bare <- tempfile(pattern = "git2r-") 330s > path_repo <- tempfile(pattern = "git2r-") 330s > 330s > dir.create(path_bare) 330s > dir.create(path_repo) 330s > 330s > ## Create bare repository 330s > bare_repo <- init(path_bare, bare = TRUE) 330s > 330s > ## Clone to repo 330s > repo <- clone(path_bare, path_repo) 330s cloning into '/tmp/RtmpfnaiAf/git2r-a8212baa2d3'... 330s > config(repo, user.name = "Alice", user.email = "alice@example.org") 330s > 330s > ## Add changes to repo 330s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 330s + con = file.path(path_repo, "test.txt")) 330s > add(repo, "test.txt") 330s > commit_1 <- commit(repo, "First commit message") 330s > 330s > ## Add more changes to repo 330s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 330s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 330s + con = file.path(path_repo, "test.txt")) 330s > add(repo, "test.txt") 330s > commit_2 <- commit(repo, "Second commit message") 330s > 330s > ## Check remote 330s > stopifnot(identical( 330s + git2r:::get_refspec(repo, spec = "master")$remote, 330s + "origin")) 330s > 330s > ## Detach 330s > checkout(commit_1) 330s > tools::assertError(git2r:::get_refspec(repo)) 330s > 330s > ## Cleanup 330s > unlink(path_bare, recursive = TRUE) 330s > unlink(path_repo, recursive = TRUE) 330s > 330s BEGIN TEST remotes.R 330s 330s R version 4.4.3 (2025-02-28) -- "Trophy Case" 330s Copyright (C) 2025 The R Foundation for Statistical Computing 330s Platform: aarch64-unknown-linux-gnu 330s 330s R is free software and comes with ABSOLUTELY NO WARRANTY. 330s You are welcome to redistribute it under certain conditions. 330s Type 'license()' or 'licence()' for distribution details. 330s 330s R is a collaborative project with many contributors. 330s Type 'contributors()' for more information and 330s 'citation()' on how to cite R or R packages in publications. 330s 330s Type 'demo()' for some demos, 'help()' for on-line help, or 330s 'help.start()' for an HTML browser interface to help. 330s Type 'q()' to quit R. 330s 330s > ## git2r, R bindings to the libgit2 library. 330s > ## Copyright (C) 2013-2023 The git2r contributors 330s > ## 330s > ## This program is free software; you can redistribute it and/or modify 330s > ## it under the terms of the GNU General Public License, version 2, 330s > ## as published by the Free Software Foundation. 330s > ## 330s > ## git2r is distributed in the hope that it will be useful, 330s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 330s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 330s > ## GNU General Public License for more details. 330s > ## 330s > ## You should have received a copy of the GNU General Public License along 330s > ## with this program; if not, write to the Free Software Foundation, Inc., 330s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 330s > 330s > library("git2r") 330s > 330s > ## For debugging 330s > sessionInfo() 330s R version 4.4.3 (2025-02-28) 330s Platform: aarch64-unknown-linux-gnu 330s Running under: Ubuntu Plucky Puffin (development branch) 330s 330s Matrix products: default 330s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 330s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 330s 330s locale: 330s [1] C 330s 330s time zone: Etc/UTC 330s tzcode source: system (glibc) 330s 330s attached base packages: 330s [1] stats graphics grDevices utils datasets methods base 330s 330s other attached packages: 330s [1] git2r_0.35.0 330s 330s loaded via a namespace (and not attached): 330s [1] compiler_4.4.3 330s > libgit2_version() 330s $major 330s [1] 1 330s 330s $minor 330s [1] 9 330s 330s $rev 330s [1] 0 330s 330s > libgit2_features() 330s $threads 330s [1] TRUE 330s 330s $https 330s [1] TRUE 330s 330s $ssh 330s [1] TRUE 330s 330s > 330s > 330s > ## Create a directory in tempdir 330s > path <- tempfile(pattern = "git2r-") 330s > dir.create(path) 330s > 330s > ## Initialize a repository 330s > repo <- init(path) 330s > config(repo, user.name = "Alice", user.email = "alice@example.org") 330s > 330s > ## Create a file 330s > writeLines("Hello world!", file.path(path, "test.txt")) 330s > 330s > ## Add and commit 330s > add(repo, "test.txt") 330s > commit_1 <- commit(repo, "Commit message") 330s > 330s > ## Add a remote 330s > remote_add(repo, "playground", 330s + "https://github.com/gaborcsardi/playground") 330s > 330s > stopifnot(identical(remotes(repo), "playground")) 330s > stopifnot(identical(remote_url(repo, "playground"), 330s + "https://github.com/gaborcsardi/playground")) 330s > stopifnot(identical(remote_url(repo), 330s + "https://github.com/gaborcsardi/playground")) 330s > 330s > ## Rename a remote 330s > remote_rename(repo, "playground", "foobar") 330s > 330s > stopifnot(identical(remotes(repo), "foobar")) 330s > stopifnot(identical(remote_url(repo, "foobar"), 330s + "https://github.com/gaborcsardi/playground")) 330s > 330s > ## Set remote url 330s > remote_set_url(repo, "foobar", "https://github.com/stewid/playground") 330s > stopifnot(identical(remote_url(repo, "foobar"), 330s + "https://github.com/stewid/playground")) 330s > 330s > ## Remove a remote 330s > remote_remove(repo, "foobar") 330s > 330s > stopifnot(identical(remotes(repo), character(0))) 330s > 330s > if (identical(Sys.getenv("NOT_CRAN"), "true")) { 330s + if (isTRUE(libgit2_features()$https)) { 330s + refs <- remote_ls("https://github.com/ropensci/git2r") 330s + stopifnot(length(refs) > 0) 330s + stopifnot(names(refs) > 0) 330s + stopifnot(any(names(refs) == "HEAD")) 330s + } 330s + } 330s > 330s > # an invalid URL should throw an error 330s > tools::assertError(remote_ls("bad")) 330s > 330s > ## Cleanup 330s > unlink(path, recursive = TRUE) 330s > 330s BEGIN TEST remove.R 330s 330s R version 4.4.3 (2025-02-28) -- "Trophy Case" 330s Copyright (C) 2025 The R Foundation for Statistical Computing 330s Platform: aarch64-unknown-linux-gnu 330s 330s R is free software and comes with ABSOLUTELY NO WARRANTY. 330s You are welcome to redistribute it under certain conditions. 330s Type 'license()' or 'licence()' for distribution details. 330s 330s R is a collaborative project with many contributors. 330s Type 'contributors()' for more information and 330s 'citation()' on how to cite R or R packages in publications. 330s 330s Type 'demo()' for some demos, 'help()' for on-line help, or 330s 'help.start()' for an HTML browser interface to help. 330s Type 'q()' to quit R. 330s 330s > ## git2r, R bindings to the libgit2 library. 330s > ## Copyright (C) 2013-2023 The git2r contributors 330s > ## 330s > ## This program is free software; you can redistribute it and/or modify 330s > ## it under the terms of the GNU General Public License, version 2, 330s > ## as published by the Free Software Foundation. 330s > ## 330s > ## git2r is distributed in the hope that it will be useful, 330s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 330s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 330s > ## GNU General Public License for more details. 330s > ## 330s > ## You should have received a copy of the GNU General Public License along 330s > ## with this program; if not, write to the Free Software Foundation, Inc., 330s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 330s > 330s > library("git2r") 330s > 330s > ## For debugging 330s > sessionInfo() 330s R version 4.4.3 (2025-02-28) 330s Platform: aarch64-unknown-linux-gnu 330s Running under: Ubuntu Plucky Puffin (development branch) 330s 330s Matrix products: default 330s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 330s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 330s 330s locale: 330s [1] C 330s 330s time zone: Etc/UTC 330s tzcode source: system (glibc) 330s 330s attached base packages: 330s [1] stats graphics grDevices utils datasets methods base 330s 330s other attached packages: 330s [1] git2r_0.35.0 330s 330s loaded via a namespace (and not attached): 330s [1] compiler_4.4.3 330s > libgit2_version() 330s $major 330s [1] 1 330s 330s $minor 330s [1] 9 330s 330s $rev 330s [1] 0 330s 330s > libgit2_features() 330s $threads 330s [1] TRUE 330s 330s $https 330s [1] TRUE 330s 330s $ssh 330s [1] TRUE 330s 330s > 330s > 330s > ## Create a directory in tempdir 330s > path <- tempfile(pattern = "git2r-") 330s > dir.create(path) 330s > 330s > ## Initialize a repository 330s > repo <- init(path) 330s > config(repo, user.name = "Alice", user.email = "alice@example.org") 330s > 330s > ## Add files 330s > invisible(lapply(file.path(path, letters[1:4]), writeLines, text = "")) 330s > add(repo, letters) 330s > commit(repo, "init") 330s [fd9d0a4] 2025-03-15: init 330s > 330s > ## Remove one file 330s > rm_file(repo, letters[1]) 330s > commit(repo, "remove") 330s [4b22511] 2025-03-15: remove 330s > 330s > ## Remove two files. Don't raise warnings 330s > withCallingHandlers(rm_file(repo, letters[2:3]), warning = function(w) stop(w)) 330s > 330s > ## Remove one file using the absolute path to the file. 330s > rm_file(repo, file.path(path, letters[4])) 330s > 330s > ## Cleanup 330s > unlink(path, recursive = TRUE) 330s > 330s BEGIN TEST repository.R 330s 330s R version 4.4.3 (2025-02-28) -- "Trophy Case" 330s Copyright (C) 2025 The R Foundation for Statistical Computing 330s Platform: aarch64-unknown-linux-gnu 330s 330s R is free software and comes with ABSOLUTELY NO WARRANTY. 330s You are welcome to redistribute it under certain conditions. 330s Type 'license()' or 'licence()' for distribution details. 330s 330s R is a collaborative project with many contributors. 330s Type 'contributors()' for more information and 330s 'citation()' on how to cite R or R packages in publications. 330s 330s Type 'demo()' for some demos, 'help()' for on-line help, or 330s 'help.start()' for an HTML browser interface to help. 330s Type 'q()' to quit R. 330s 330s > ## git2r, R bindings to the libgit2 library. 330s > ## Copyright (C) 2013-2023 The git2r contributors 330s > ## 330s > ## This program is free software; you can redistribute it and/or modify 330s > ## it under the terms of the GNU General Public License, version 2, 330s > ## as published by the Free Software Foundation. 330s > ## 330s > ## git2r is distributed in the hope that it will be useful, 330s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 330s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 330s > ## GNU General Public License for more details. 330s > ## 330s > ## You should have received a copy of the GNU General Public License along 330s > ## with this program; if not, write to the Free Software Foundation, Inc., 330s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 330s > 330s > library(git2r) 330s > source("util/check.R") 330s > 330s > ## For debugging 330s > sessionInfo() 330s R version 4.4.3 (2025-02-28) 330s Platform: aarch64-unknown-linux-gnu 330s Running under: Ubuntu Plucky Puffin (development branch) 330s 330s Matrix products: default 330s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 330s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 330s 330s locale: 330s [1] C 330s 330s time zone: Etc/UTC 330s tzcode source: system (glibc) 330s 330s attached base packages: 330s [1] stats graphics grDevices utils datasets methods base 330s 330s other attached packages: 330s [1] git2r_0.35.0 330s 330s loaded via a namespace (and not attached): 330s [1] compiler_4.4.3 330s > libgit2_version() 330s $major 330s [1] 1 330s 330s $minor 330s [1] 9 330s 330s $rev 330s [1] 0 330s 330s > libgit2_features() 330s $threads 330s [1] TRUE 330s 330s $https 330s [1] TRUE 330s 330s $ssh 330s [1] TRUE 330s 330s > 330s > 330s > ## Create a directory in tempdir 330s > path <- tempfile(pattern = "git2r-") 330s > dir.create(path) 330s > 330s > ## is_bare: "Invalid repository" 330s > tools::assertError(is_bare(new("git_repository"))) 330s > 330s > ## is_empty: "Invalid repository" 330s > tools::assertError(is_empty(new("git_repository"))) 330s > 330s > ## Check that open an invalid repository fails 330s > tools::assertError(repository(path)) 330s > tools::assertError(repository(path, discover = FALSE)) 330s > 330s > ## Check that it fails to open/init a repository with a path to a 330s > ## file. 330s > writeLines("test", file.path(path, "test.txt")) 330s > tools::assertError(repository(file.path(path, "test.txt"), 330s + discover = FALSE)) 330s > tools::assertError(init(file.path(path, "test.txt"))) 330s > unlink(file.path(path, "test.txt")) 330s > 330s > ## Initialize a repository 330s > repo <- init(path) 330s > stopifnot(identical(print(repo), repo)) 330s Local: /tmp/RtmpN2YGe8/git2r-aa633f8c4f8 330s Head: nothing commited (yet) 330s > 330s > ## Check the state of the repository 330s > stopifnot(identical(is_bare(repo), FALSE)) 330s > stopifnot(identical(is_empty(repo), TRUE)) 330s > stopifnot(identical(is_shallow(repo), FALSE)) 330s > stopifnot(identical(branches(repo), empty_named_list())) 330s > stopifnot(identical(references(repo), empty_named_list())) 330s Warning message: 330s In normalizePath(path) : 330s path[1]="/tmp/RtmpN2YGe8/git2r-aa633f8c4f8/doesntexist.txt": No such file or directory 330s > stopifnot(identical(commits(repo), list())) 330s > stopifnot(identical(repository_head(repo), NULL)) 330s > 330s > # check that we can find repository from a path 330s > wd <- sub(paste0("[", .Platform$file.sep, "]$"), "", workdir(repo)) 330s > writeLines("test file", con = file.path(wd, "myfile.txt")) 330s > stopifnot(identical(discover_repository(file.path(wd, "myfile.txt")), 330s + file.path(wd, ".git"))) 330s > stopifnot(identical(discover_repository(file.path(wd, "doesntexist.txt")), 330s + NULL)) 330s > 330s > # Check that we can use ceiling in discover repostiory 330s > dir.create(file.path(wd, "temp")) 330s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 0), NULL)) 330s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 1), 330s + file.path(wd, ".git"))) 330s > tools::assertError(discover_repository(file.path(wd, "temp"), 2)) 330s > 330s > ## Check that lookup with a sha of less than 4 characters or more than 330s > ## 40 characters fail. 330s > tools::assertError(lookup(repo, paste0(rep("a", 3), collapse = ""))) 330s > tools::assertError(lookup(repo, paste0(rep("a", 41), collapse = ""))) 330s > 330s > ## Check in_repository 330s > stopifnot(identical(in_repository(path), TRUE)) 330s > 330s > ## Check: 330s > ## - in_repository method with missing path argument 330s > ## - repository method with missing path argument 330s > ## - workdir method with missing path argument 330s > ## - is_empty method with missing repo argument 330s > ## - is_shallow method with missing repo argument 330s > wd <- setwd(path) 330s > stopifnot(identical(in_repository(), TRUE)) 330s > stopifnot(identical(workdir(repository(path)), workdir(repository()))) 330s > stopifnot(identical(workdir(repository(path)), workdir())) 330s > stopifnot(identical(is_empty(), TRUE)) 330s > stopifnot(identical(is_shallow(), FALSE)) 330s > if (!is.null(wd)) 330s + setwd(wd) 330s > 330s > ## Cleanup 330s > unlink(path, recursive = TRUE) 330s > 330s BEGIN TEST reset.R 331s 331s R version 4.4.3 (2025-02-28) -- "Trophy Case" 331s Copyright (C) 2025 The R Foundation for Statistical Computing 331s Platform: aarch64-unknown-linux-gnu 331s 331s R is free software and comes with ABSOLUTELY NO WARRANTY. 331s You are welcome to redistribute it under certain conditions. 331s Type 'license()' or 'licence()' for distribution details. 331s 331s R is a collaborative project with many contributors. 331s Type 'contributors()' for more information and 331s 'citation()' on how to cite R or R packages in publications. 331s 331s Type 'demo()' for some demos, 'help()' for on-line help, or 331s 'help.start()' for an HTML browser interface to help. 331s Type 'q()' to quit R. 331s 331s > ## git2r, R bindings to the libgit2 library. 331s > ## Copyright (C) 2013-2023 The git2r contributors 331s > ## 331s > ## This program is free software; you can redistribute it and/or modify 331s > ## it under the terms of the GNU General Public License, version 2, 331s > ## as published by the Free Software Foundation. 331s > ## 331s > ## git2r is distributed in the hope that it will be useful, 331s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 331s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 331s > ## GNU General Public License for more details. 331s > ## 331s > ## You should have received a copy of the GNU General Public License along 331s > ## with this program; if not, write to the Free Software Foundation, Inc., 331s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 331s > 331s > library(git2r) 331s > source("util/check.R") 331s > 331s > ## For debugging 331s > sessionInfo() 331s R version 4.4.3 (2025-02-28) 331s Platform: aarch64-unknown-linux-gnu 331s Running under: Ubuntu Plucky Puffin (development branch) 331s 331s Matrix products: default 331s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 331s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 331s 331s locale: 331s [1] C 331s 331s time zone: Etc/UTC 331s tzcode source: system (glibc) 331s 331s attached base packages: 331s [1] stats graphics grDevices utils datasets methods base 331s 331s other attached packages: 331s [1] git2r_0.35.0 331s 331s loaded via a namespace (and not attached): 331s [1] compiler_4.4.3 331s > libgit2_version() 331s $major 331s [1] 1 331s 331s $minor 331s [1] 9 331s 331s $rev 331s [1] 0 331s 331s > libgit2_features() 331s $threads 331s [1] TRUE 331s 331s $https 331s [1] TRUE 331s 331s $ssh 331s [1] TRUE 331s 331s > 331s > 331s > ## Create a directory in tempdir 331s > path <- tempfile(pattern = "git2r-") 331s > dir.create(path) 331s > 331s > ## Initialize a repository 331s > repo <- init(path) 331s > config(repo, user.name = "Alice", user.email = "alice@example.org") 331s > 331s > ## Create a file 331s > writeLines("Hello world!", file.path(path, "test-1.txt")) 331s > 331s > ## Add and reset an empty repository using a path 331s > add(repo, "test-1.txt") 331s > stopifnot(identical( 331s + status(repo), 331s + structure(list(staged = list(new = "test-1.txt"), 331s + unstaged = empty_named_list(), 331s + untracked = empty_named_list()), 331s + class = "git_status"))) 331s > reset(repo, path = "test-1.txt") 331s > stopifnot(identical( 331s + status(repo), 331s + structure(list(staged = empty_named_list(), 331s + unstaged = empty_named_list(), 331s + untracked = list(untracked = "test-1.txt")), 331s + class = "git_status"))) 331s > 331s > ## Add and reset a non-empty repository using a path 331s > add(repo, "test-1.txt") 331s > commit(repo, "First commit") 331s [b8ad4ac] 2025-03-15: First commit 331s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 331s > add(repo, "test-1.txt") 331s > stopifnot(identical( 331s + status(repo), 331s + structure(list(staged = list(modified = "test-1.txt"), 331s + unstaged = empty_named_list(), 331s + untracked = empty_named_list()), 331s + class = "git_status"))) 331s > reset(repo, path = "test-1.txt") 331s > stopifnot(identical( 331s + status(repo), 331s + structure(list(staged = empty_named_list(), 331s + unstaged = list(modified = "test-1.txt"), 331s + untracked = empty_named_list()), 331s + class = "git_status"))) 331s > 331s > ## add and commit 331s > add(repo, "test-1.txt") 331s > commit_1 <- commit(repo, "Commit message") 331s > 331s > ## Make one more commit 331s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 331s + file.path(path, "test-1.txt")) 331s > add(repo, "test-1.txt") 331s > commit(repo, "Next commit message") 331s [a522e91] 2025-03-15: Next commit message 331s > 331s > ## Create one more file 331s > writeLines("Hello world!", file.path(path, "test-2.txt")) 331s > 331s > ## 'soft' reset to first commit 331s > reset(commit_1) 331s > soft_exp <- structure(list(staged = list(modified = "test-1.txt"), 331s + unstaged = empty_named_list(), 331s + untracked = list(untracked = "test-2.txt")), 331s + class = "git_status") 331s > soft_obs <- status(repo) 331s > stopifnot(identical(soft_obs, soft_exp)) 331s > stopifnot(identical(length(commits(repo)), 2L)) 331s > stopifnot(identical(commits(repo)[[1]], commit_1)) 331s > 331s > ## 'mixed' reset to first commit 331s > commit(repo, "Next commit message") 331s [a522e91] 2025-03-15: Next commit message 331s > reset(commit_1, "mixed") 331s > mixed_exp <- structure(list(staged = empty_named_list(), 331s + unstaged = list(modified = "test-1.txt"), 331s + untracked = list(untracked = "test-2.txt")), 331s + class = "git_status") 331s > mixed_obs <- status(repo) 331s > stopifnot(identical(mixed_obs, mixed_exp)) 331s > stopifnot(identical(length(commits(repo)), 2L)) 331s > stopifnot(identical(commits(repo)[[1]], commit_1)) 331s > 331s > ## 'hard' reset to first commit 331s > add(repo, "test-1.txt") 331s > commit(repo, "Next commit message") 331s [a522e91] 2025-03-15: Next commit message 331s > reset(commit_1, "hard") 331s > hard_exp <- structure(list(staged = empty_named_list(), 331s + unstaged = empty_named_list(), 331s + untracked = list(untracked = "test-2.txt")), 331s + class = "git_status") 331s > hard_obs <- status(repo) 331s > stopifnot(identical(hard_obs, hard_exp)) 331s > stopifnot(identical(length(commits(repo)), 2L)) 331s > stopifnot(identical(commits(repo)[[1]], commit_1)) 331s > 331s > ## Cleanup 331s > unlink(path, recursive = TRUE) 331s > 331s BEGIN TEST revparse.R 331s 331s R version 4.4.3 (2025-02-28) -- "Trophy Case" 331s Copyright (C) 2025 The R Foundation for Statistical Computing 331s Platform: aarch64-unknown-linux-gnu 331s 331s R is free software and comes with ABSOLUTELY NO WARRANTY. 331s You are welcome to redistribute it under certain conditions. 331s Type 'license()' or 'licence()' for distribution details. 331s 331s R is a collaborative project with many contributors. 331s Type 'contributors()' for more information and 331s 'citation()' on how to cite R or R packages in publications. 331s 331s Type 'demo()' for some demos, 'help()' for on-line help, or 331s 'help.start()' for an HTML browser interface to help. 331s Type 'q()' to quit R. 331s 331s > ## git2r, R bindings to the libgit2 library. 331s > ## Copyright (C) 2013-2023 The git2r contributors 331s > ## 331s > ## This program is free software; you can redistribute it and/or modify 331s > ## it under the terms of the GNU General Public License, version 2, 331s > ## as published by the Free Software Foundation. 331s > ## 331s > ## git2r is distributed in the hope that it will be useful, 331s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 331s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 331s > ## GNU General Public License for more details. 331s > ## 331s > ## You should have received a copy of the GNU General Public License along 331s > ## with this program; if not, write to the Free Software Foundation, Inc., 331s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 331s > 331s > library("git2r") 331s > 331s > ## For debugging 331s > sessionInfo() 331s R version 4.4.3 (2025-02-28) 331s Platform: aarch64-unknown-linux-gnu 331s Running under: Ubuntu Plucky Puffin (development branch) 331s 331s Matrix products: default 331s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 331s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 331s 331s locale: 331s [1] C 331s 331s time zone: Etc/UTC 331s tzcode source: system (glibc) 331s 331s attached base packages: 331s [1] stats graphics grDevices utils datasets methods base 331s 331s other attached packages: 331s [1] git2r_0.35.0 331s 331s loaded via a namespace (and not attached): 331s [1] compiler_4.4.3 331s > libgit2_version() 331s $major 331s [1] 1 331s 331s $minor 331s [1] 9 331s 331s $rev 331s [1] 0 331s 331s > libgit2_features() 331s $threads 331s [1] TRUE 331s 331s $https 331s [1] TRUE 331s 331s $ssh 331s [1] TRUE 331s 331s > 331s > 331s > ## Create a directory in tempdir 331s > path <- tempfile(pattern = "git2r-") 331s > dir.create(path) 331s > 331s > ## Initialize a repository 331s > repo <- init(path) 331s > config(repo, user.name = "Alice", user.email = "alice@example.org") 331s > 331s > ## Create a file 331s > writeLines("Hello world!", file.path(path, "test.txt")) 331s > 331s > ## Add and commit 331s > add(repo, "test.txt") 331s > commit_1 <- commit(repo, "First commit message") 331s > 331s > tools::assertError(revparse_single(repo, "HEAD^")) 331s > 331s > ## Add another commit 331s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 331s > add(repo, "test.txt") 331s > commit(repo, "Second commit message") 331s [2f0e963] 2025-03-15: Second commit message 331s > 331s > stopifnot(identical(revparse_single(repo, "HEAD^"), commit_1)) 331s > stopifnot(is_blob(revparse_single(repo, "HEAD:test.txt"))) 331s > 331s > ## Cleanup 331s > unlink(path, recursive = TRUE) 331s > 331s BEGIN TEST signature.R 331s 331s R version 4.4.3 (2025-02-28) -- "Trophy Case" 331s Copyright (C) 2025 The R Foundation for Statistical Computing 331s Platform: aarch64-unknown-linux-gnu 331s 331s R is free software and comes with ABSOLUTELY NO WARRANTY. 331s You are welcome to redistribute it under certain conditions. 331s Type 'license()' or 'licence()' for distribution details. 331s 331s R is a collaborative project with many contributors. 331s Type 'contributors()' for more information and 331s 'citation()' on how to cite R or R packages in publications. 331s 331s Type 'demo()' for some demos, 'help()' for on-line help, or 331s 'help.start()' for an HTML browser interface to help. 331s Type 'q()' to quit R. 331s 331s > ## git2r, R bindings to the libgit2 library. 331s > ## Copyright (C) 2013-2023 The git2r contributors 331s > ## 331s > ## This program is free software; you can redistribute it and/or modify 331s > ## it under the terms of the GNU General Public License, version 2, 331s > ## as published by the Free Software Foundation. 331s > ## 331s > ## git2r is distributed in the hope that it will be useful, 331s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 331s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 331s > ## GNU General Public License for more details. 331s > ## 331s > ## You should have received a copy of the GNU General Public License along 331s > ## with this program; if not, write to the Free Software Foundation, Inc., 331s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 331s > 331s > library("git2r") 331s > 331s > ## For debugging 331s > sessionInfo() 331s R version 4.4.3 (2025-02-28) 331s Platform: aarch64-unknown-linux-gnu 331s Running under: Ubuntu Plucky Puffin (development branch) 331s 331s Matrix products: default 331s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 331s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 331s 331s locale: 331s [1] C 331s 331s time zone: Etc/UTC 331s tzcode source: system (glibc) 331s 331s attached base packages: 331s [1] stats graphics grDevices utils datasets methods base 331s 331s other attached packages: 331s [1] git2r_0.35.0 331s 331s loaded via a namespace (and not attached): 331s [1] compiler_4.4.3 331s > libgit2_version() 331s $major 331s [1] 1 331s 331s $minor 331s [1] 9 331s 331s $rev 331s [1] 0 331s 331s > libgit2_features() 331s $threads 331s [1] TRUE 331s 331s $https 331s [1] TRUE 331s 331s $ssh 331s [1] TRUE 331s 331s > 331s > 331s > ## Check printing of a class git_signature 331s > when <- structure(list(time = 1395567947, offset = 60), 331s + class = "git_time") 331s > 331s > signature <- structure(list(name = "Alice", 331s + email = "alice@example.org", 331s + when = when), 331s + class = "git_signature") 331s > stopifnot(identical(print(signature), signature)) 331s name: Alice 331s email: alice@example.org 331s when: 2014-03-23 09:45:47 GMT 331s > 331s BEGIN TEST stash.R 331s 331s R version 4.4.3 (2025-02-28) -- "Trophy Case" 331s Copyright (C) 2025 The R Foundation for Statistical Computing 331s Platform: aarch64-unknown-linux-gnu 331s 331s R is free software and comes with ABSOLUTELY NO WARRANTY. 331s You are welcome to redistribute it under certain conditions. 331s Type 'license()' or 'licence()' for distribution details. 331s 331s R is a collaborative project with many contributors. 331s Type 'contributors()' for more information and 331s 'citation()' on how to cite R or R packages in publications. 331s 331s Type 'demo()' for some demos, 'help()' for on-line help, or 331s 'help.start()' for an HTML browser interface to help. 331s Type 'q()' to quit R. 331s 331s > ## git2r, R bindings to the libgit2 library. 331s > ## Copyright (C) 2013-2023 The git2r contributors 331s > ## 331s > ## This program is free software; you can redistribute it and/or modify 331s > ## it under the terms of the GNU General Public License, version 2, 331s > ## as published by the Free Software Foundation. 331s > ## 331s > ## git2r is distributed in the hope that it will be useful, 331s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 331s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 331s > ## GNU General Public License for more details. 331s > ## 331s > ## You should have received a copy of the GNU General Public License along 331s > ## with this program; if not, write to the Free Software Foundation, Inc., 331s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 331s > 331s > library("git2r") 331s > 331s > ## For debugging 331s > sessionInfo() 331s R version 4.4.3 (2025-02-28) 331s Platform: aarch64-unknown-linux-gnu 331s Running under: Ubuntu Plucky Puffin (development branch) 331s 331s Matrix products: default 331s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 331s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 331s 331s locale: 331s [1] C 331s 331s time zone: Etc/UTC 331s tzcode source: system (glibc) 331s 331s attached base packages: 331s [1] stats graphics grDevices utils datasets methods base 331s 331s other attached packages: 331s [1] git2r_0.35.0 331s 331s loaded via a namespace (and not attached): 331s [1] compiler_4.4.3 331s > libgit2_version() 331s $major 331s [1] 1 331s 331s $minor 331s [1] 9 331s 331s $rev 331s [1] 0 331s 331s > libgit2_features() 331s $threads 331s [1] TRUE 331s 331s $https 331s [1] TRUE 331s 331s $ssh 331s [1] TRUE 331s 331s > 331s > 331s > ## Create a directory in tempdir 331s > path <- tempfile(pattern = "git2r-") 331s > dir.create(path) 331s > 331s > ## Initialize a repository 331s > repo <- init(path) 331s > config(repo, user.name = "Alice", user.email = "alice@example.org") 331s > 331s > ## Create a file 331s > writeLines("Hello world!", file.path(path, "test-1.txt")) 331s > 331s > ## add and commit 331s > add(repo, "test-1.txt") 331s > commit(repo, "Commit message") 331s [e7aff33] 2025-03-15: Commit message 331s > 331s > ## Pop stash 331s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 331s > stash(repo) 331s > stopifnot(identical("Hello world!", 331s + readLines(file.path(path, "test-1.txt")))) 331s > stash_pop(repo) 331s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 331s + readLines(file.path(path, "test-1.txt")))) 331s > 331s > ## Make one more commit 331s > add(repo, "test-1.txt") 331s > commit(repo, "Next commit message") 331s [4ee8d63] 2025-03-15: Next commit message 331s > 331s > ## Check that there are no stashes 331s > stopifnot(identical(stash_list(repo), list())) 331s > 331s > ## Apply stash 331s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 331s + file.path(path, "test-1.txt")) 331s > stash(repo) 331s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 331s + readLines(file.path(path, "test-1.txt")))) 331s > stash_apply(repo) 331s > stopifnot(identical(c("Hello world!", "HELLO WORLD!", "hello world!"), 331s + readLines(file.path(path, "test-1.txt")))) 331s > stopifnot(identical(length(stash_list(repo)), 1L)) 331s > stash_drop(repo, 1) 331s > stopifnot(identical(stash_list(repo), list())) 331s > 331s > ## Make one more commit 331s > add(repo, "test-1.txt") 331s > commit(repo, "Apply stash commit message") 332s [79d9ac1] 2025-03-15: Apply stash commit message 332s > 332s > ## Create one more file 332s > writeLines("Hello world!", file.path(path, "test-2.txt")) 332s > 332s > ## Check that there are no stashes 332s > stopifnot(identical(stash_list(repo), list())) 332s > 332s > ## Stash 332s > stash(repo) 332s > stopifnot(identical(stash_list(repo), list())) 332s > s <- stash(repo, untracked = TRUE) 332s > stopifnot(identical(print(s), s)) 332s On master: 2025-03-15 14:47:51.97044 332s 332s > summary(s) 332s message: On master: 2025-03-15 14:47:51.97044 332s stasher: Alice 332s when: 2025-03-15 14:47:51 GMT 332s sha: 16f4b90e7fbd2ef5f373cc4286025b5f0cc3b7ae 332s 332s > stopifnot(identical(length(stash_list(repo)), 1L)) 332s > tree(stash_list(repo)[[1]]) 332s tree: af5711badde07055d853088e98c6d988bfdd139f 332s 332s mode type sha name 332s 1 100644 blob 5b168e5ff4e9eeff020b99a3c1c83c4979294e76 test-1.txt 332s > 332s > ## Drop stash 332s > stash_drop(repo, 1) 332s > stopifnot(identical(stash_list(repo), list())) 332s > 332s > ## Check stash_drop argument 332s > tools::assertError(stash_drop(repo)) 332s > tools::assertError(stash_drop(repo, -1)) 332s > tools::assertError(stash_drop(repo, 0.5)) 332s > 332s > ## Create one more file 332s > writeLines("Hello world!", file.path(path, "test-3.txt")) 332s > 332s > ## Create stash in repository 332s > stash(repo, untracked = TRUE) 332s > stopifnot(identical(length(stash_list(repo)), 1L)) 332s > 332s > ## Check stash_list method with missing repo argument 332s > wd <- setwd(path) 332s > stopifnot(identical(length(stash_list()), 1L)) 332s > if (!is.null(wd)) 332s + setwd(wd) 332s > 332s > ## Drop git_stash object in repository 332s > stash_drop(stash_list(repo)[[1]]) 332s > 332s > ## Cleanup 332s > unlink(path, recursive = TRUE) 332s > 332s BEGIN TEST status.R 332s 332s R version 4.4.3 (2025-02-28) -- "Trophy Case" 332s Copyright (C) 2025 The R Foundation for Statistical Computing 332s Platform: aarch64-unknown-linux-gnu 332s 332s R is free software and comes with ABSOLUTELY NO WARRANTY. 332s You are welcome to redistribute it under certain conditions. 332s Type 'license()' or 'licence()' for distribution details. 332s 332s R is a collaborative project with many contributors. 332s Type 'contributors()' for more information and 332s 'citation()' on how to cite R or R packages in publications. 332s 332s Type 'demo()' for some demos, 'help()' for on-line help, or 332s 'help.start()' for an HTML browser interface to help. 332s Type 'q()' to quit R. 332s 332s > ## git2r, R bindings to the libgit2 library. 332s > ## Copyright (C) 2013-2023 The git2r contributors 332s > ## 332s > ## This program is free software; you can redistribute it and/or modify 332s > ## it under the terms of the GNU General Public License, version 2, 332s > ## as published by the Free Software Foundation. 332s > ## 332s > ## git2r is distributed in the hope that it will be useful, 332s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 332s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 332s > ## GNU General Public License for more details. 332s > ## 332s > ## You should have received a copy of the GNU General Public License along 332s > ## with this program; if not, write to the Free Software Foundation, Inc., 332s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 332s > 332s > library(git2r) 332s > source("util/check.R") 332s > 332s > ## For debugging 332s > sessionInfo() 332s R version 4.4.3 (2025-02-28) 332s Platform: aarch64-unknown-linux-gnu 332s Running under: Ubuntu Plucky Puffin (development branch) 332s 332s Matrix products: default 332s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 332s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 332s 332s locale: 332s [1] C 332s 332s time zone: Etc/UTC 332s tzcode source: system (glibc) 332s 332s attached base packages: 332s [1] stats graphics grDevices utils datasets methods base 332s 332s other attached packages: 332s [1] git2r_0.35.0 332s 332s loaded via a namespace (and not attached): 332s [1] compiler_4.4.3 332s > libgit2_version() 332s $major 332s [1] 1 332s 332s $minor 332s [1] 9 332s 332s $rev 332s [1] 0 332s 332s > libgit2_features() 332s $threads 332s [1] TRUE 332s 332s $https 332s [1] TRUE 332s 332s $ssh 332s [1] TRUE 332s 332s > 332s > 332s > ## Create a directory in tempdir 332s > path <- tempfile(pattern = "git2r-") 332s > dir.create(path) 332s > 332s > ## Initialize a repository 332s > repo <- init(path) 332s > config(repo, user.name = "Alice", user.email = "alice@example.org") 332s > 332s > ## Status case 1 332s > status_exp_1 <- structure(list(staged = empty_named_list(), 332s + unstaged = empty_named_list(), 332s + untracked = empty_named_list()), 332s + class = "git_status") 332s > status_obs_1 <- status(repo) 332s > stopifnot(identical(print(status_obs_1), status_obs_1)) 332s working directory clean 332s > str(status_exp_1) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked: Named list() 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_1) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked: Named list() 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_1, status_exp_1)) 332s > stopifnot(identical(capture.output(status(repo)), 332s + "working directory clean")) 332s > 332s > ## Status case 2, include ignored files 332s > status_exp_2 <- structure(list(staged = empty_named_list(), 332s + unstaged = empty_named_list(), 332s + untracked = empty_named_list(), 332s + ignored = empty_named_list()), 332s + class = "git_status") 332s > status_obs_2 <- status(repo, ignored = TRUE) 332s > status_obs_2 332s working directory clean 332s > str(status_exp_2) 332s List of 4 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked: Named list() 332s $ ignored : Named list() 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_2) 332s List of 4 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked: Named list() 332s $ ignored : Named list() 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_2, status_exp_2)) 332s > stopifnot(identical(capture.output(status(repo, ignored = TRUE)), 332s + "working directory clean")) 332s > 332s > ## Create 4 files 332s > writeLines("File-1", file.path(path, "test-1.txt")) 332s > writeLines("File-2", file.path(path, "test-2.txt")) 332s > writeLines("File-3", file.path(path, "test-3.txt")) 332s > writeLines("File-4", file.path(path, "test-4.txt")) 332s > 332s > ## Status case 3: 4 untracked files 332s > status_exp_3 <- structure(list(staged = empty_named_list(), 332s + unstaged = empty_named_list(), 332s + untracked = list(untracked = "test-1.txt", 332s + untracked = "test-2.txt", 332s + untracked = "test-3.txt", 332s + untracked = "test-4.txt")), 332s + class = "git_status") 332s > status_obs_3 <- status(repo) 332s > status_obs_3 332s Untracked files: 332s Untracked: test-1.txt 332s Untracked: test-2.txt 332s Untracked: test-3.txt 332s Untracked: test-4.txt 332s 332s > str(status_exp_3) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked:List of 4 332s ..$ untracked: chr "test-1.txt" 332s ..$ untracked: chr "test-2.txt" 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_3) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked:List of 4 332s ..$ untracked: chr "test-1.txt" 332s ..$ untracked: chr "test-2.txt" 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_3, status_exp_3)) 332s > 332s > ## Add file 1 and 2 to the repository and commit 332s > add(repo, c("test-1.txt", "test-2.txt")) 332s > commit(repo, "Commit message") 332s [2af5023] 2025-03-15: Commit message 332s > 332s > ## Status case 4: 2 untracked files 332s > status_exp_4 <- structure(list(staged = empty_named_list(), 332s + unstaged = empty_named_list(), 332s + untracked = list(untracked = "test-3.txt", 332s + untracked = "test-4.txt")), 332s + class = "git_status") 332s > status_obs_4 <- status(repo) 332s > status_obs_4 332s Untracked files: 332s Untracked: test-3.txt 332s Untracked: test-4.txt 332s 332s > str(status_exp_4) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked:List of 2 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_4) 332s List of 3 332s $ staged : Named list() 332s $ unstaged : Named list() 332s $ untracked:List of 2 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_4, status_exp_4)) 332s > 332s > ## Update file 1 & 2 332s > writeLines(c("File-1", "Hello world"), file.path(path, "test-1.txt")) 332s > writeLines(c("File-2", "Hello world"), file.path(path, "test-2.txt")) 332s > 332s > ## Add file 1 332s > add(repo, "test-1.txt") 332s > 332s > ## Status case 5: 1 staged file, 1 unstaged file and 2 untracked files 332s > status_exp_5 <- structure(list(staged = list(modified = "test-1.txt"), 332s + unstaged = list(modified = "test-2.txt"), 332s + untracked = list(untracked = "test-3.txt", 332s + untracked = "test-4.txt")), 332s + class = "git_status") 332s > status_obs_5 <- status(repo) 332s > status_obs_5 332s Untracked files: 332s Untracked: test-3.txt 332s Untracked: test-4.txt 332s 332s Unstaged changes: 332s Modified: test-2.txt 332s 332s Staged changes: 332s Modified: test-1.txt 332s 332s > str(status_exp_5) 332s List of 3 332s $ staged :List of 1 332s ..$ modified: chr "test-1.txt" 332s $ unstaged :List of 1 332s ..$ modified: chr "test-2.txt" 332s $ untracked:List of 2 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_5) 332s List of 3 332s $ staged :List of 1 332s ..$ modified: chr "test-1.txt" 332s $ unstaged :List of 1 332s ..$ modified: chr "test-2.txt" 332s $ untracked:List of 2 332s ..$ untracked: chr "test-3.txt" 332s ..$ untracked: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_5, status_exp_5)) 332s > 332s > ## Add .gitignore file with file test-4.txt 332s > writeLines("test-4.txt", file.path(path, ".gitignore")) 332s > 332s > ## Status case 6: 1 staged file, 1 unstaged file, 2 untracked files 332s > ## and 1 ignored file 332s > status_exp_6 <- structure(list(staged = list(modified = "test-1.txt"), 332s + unstaged = list(modified = "test-2.txt"), 332s + untracked = list(untracked = ".gitignore", 332s + untracked = "test-3.txt"), 332s + ignored = list(ignored = "test-4.txt")), 332s + class = "git_status") 332s > status_obs_6 <- status(repo, ignore = TRUE) 332s > status_obs_6 332s Ignored files: 332s Ignored: test-4.txt 332s 332s Untracked files: 332s Untracked: .gitignore 332s Untracked: test-3.txt 332s 332s Unstaged changes: 332s Modified: test-2.txt 332s 332s Staged changes: 332s Modified: test-1.txt 332s 332s > str(status_exp_6) 332s List of 4 332s $ staged :List of 1 332s ..$ modified: chr "test-1.txt" 332s $ unstaged :List of 1 332s ..$ modified: chr "test-2.txt" 332s $ untracked:List of 2 332s ..$ untracked: chr ".gitignore" 332s ..$ untracked: chr "test-3.txt" 332s $ ignored :List of 1 332s ..$ ignored: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > str(status_obs_6) 332s List of 4 332s $ staged :List of 1 332s ..$ modified: chr "test-1.txt" 332s $ unstaged :List of 1 332s ..$ modified: chr "test-2.txt" 332s $ untracked:List of 2 332s ..$ untracked: chr ".gitignore" 332s ..$ untracked: chr "test-3.txt" 332s $ ignored :List of 1 332s ..$ ignored: chr "test-4.txt" 332s - attr(*, "class")= chr "git_status" 332s > stopifnot(identical(status_obs_6, status_exp_6)) 332s > 332s > ## Cleanup 332s > unlink(path, recursive = TRUE) 332s > 332s BEGIN TEST tag.R 332s 332s R version 4.4.3 (2025-02-28) -- "Trophy Case" 332s Copyright (C) 2025 The R Foundation for Statistical Computing 332s Platform: aarch64-unknown-linux-gnu 332s 332s R is free software and comes with ABSOLUTELY NO WARRANTY. 332s You are welcome to redistribute it under certain conditions. 332s Type 'license()' or 'licence()' for distribution details. 332s 332s R is a collaborative project with many contributors. 332s Type 'contributors()' for more information and 332s 'citation()' on how to cite R or R packages in publications. 332s 332s Type 'demo()' for some demos, 'help()' for on-line help, or 332s 'help.start()' for an HTML browser interface to help. 332s Type 'q()' to quit R. 332s 332s > ## git2r, R bindings to the libgit2 library. 332s > ## Copyright (C) 2013-2023 The git2r contributors 332s > ## 332s > ## This program is free software; you can redistribute it and/or modify 332s > ## it under the terms of the GNU General Public License, version 2, 332s > ## as published by the Free Software Foundation. 332s > ## 332s > ## git2r is distributed in the hope that it will be useful, 332s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 332s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 332s > ## GNU General Public License for more details. 332s > ## 332s > ## You should have received a copy of the GNU General Public License along 332s > ## with this program; if not, write to the Free Software Foundation, Inc., 332s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 332s > 332s > library(git2r) 332s > source("util/check.R") 332s > 332s > ## For debugging 332s > sessionInfo() 332s R version 4.4.3 (2025-02-28) 332s Platform: aarch64-unknown-linux-gnu 332s Running under: Ubuntu Plucky Puffin (development branch) 332s 332s Matrix products: default 332s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 332s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 332s 332s locale: 332s [1] C 332s 332s time zone: Etc/UTC 332s tzcode source: system (glibc) 332s 332s attached base packages: 332s [1] stats graphics grDevices utils datasets methods base 332s 332s other attached packages: 332s [1] git2r_0.35.0 332s 332s loaded via a namespace (and not attached): 332s [1] compiler_4.4.3 332s > libgit2_version() 332s $major 332s [1] 1 332s 332s $minor 332s [1] 9 332s 332s $rev 332s [1] 0 332s 332s > libgit2_features() 332s $threads 332s [1] TRUE 332s 332s $https 332s [1] TRUE 332s 332s $ssh 332s [1] TRUE 332s 332s > 332s > 332s > ## Create a directory in tempdir 332s > path <- tempfile(pattern = "git2r-") 332s > dir.create(path) 332s > 332s > ## Initialize a repository 332s > repo <- init(path) 332s > config(repo, user.name = "Alice", user.email = "alice@example.org") 332s > 332s > ## Create a file 332s > writeLines("Hello world!", file.path(path, "test.txt")) 332s > 332s > ## add and commit 332s > add(repo, "test.txt") 332s > commit(repo, "Commit message") 332s [93bae62] 2025-03-15: Commit message 332s > 332s > ## Check tags, no tag added 332s > stopifnot(identical(tags(repo), empty_named_list())) 332s > 332s > ## Create tag 332s > new_tag <- tag(repo, "Tagname", "Tag message") 332s > stopifnot(identical(print(new_tag), new_tag)) 332s [93bae6] Tagname 332s > summary(new_tag) 332s name: Tagname 332s target: 93bae622853729645573fc7f15e5efcd4f478b4a 332s tagger: Alice 332s when: 2025-03-15 14:47:52 GMT 332s message: Tag message 332s > 332s > ## Check tag 332s > stopifnot(identical(lookup(repo, sha(new_tag)), new_tag)) 332s > stopifnot(identical(new_tag$name, "Tagname")) 332s > stopifnot(identical(new_tag$message, "Tag message")) 332s > stopifnot(identical(new_tag$tagger$name, "Alice")) 332s > stopifnot(identical(new_tag$tagger$email, "alice@example.org")) 332s > stopifnot(identical(length(tags(repo)), 1L)) 332s > stopifnot(identical(tags(repo)[[1]]$name, "Tagname")) 332s > stopifnot(identical(tags(repo)[[1]]$message, "Tag message")) 332s > stopifnot(identical(tags(repo)[[1]]$tagger$name, "Alice")) 332s > stopifnot(identical(tags(repo)[[1]]$tagger$email, "alice@example.org")) 332s > 332s > ## Check objects in object database 332s > stopifnot(identical(table(odb_objects(repo)$type), 332s + structure(c(1L, 1L, 1L, 1L), 332s + .Dim = 4L, 332s + .Dimnames = structure(list( 332s + c("blob", "commit", "tag", "tree")), 332s + .Names = ""), 332s + class = "table"))) 332s > 332s > ## Delete tag 332s > tag_delete(new_tag) 332s > stopifnot(identical(length(tags(repo)), 0L)) 332s > 332s > ## Create tag with session info 332s > tag(repo, "Tagname", "Tag message", session = TRUE) 332s > stopifnot(grep("git2r", tags(repo)[[1]]$message) > 0) 332s > 332s > ## Check tags method with default repo argument 332s > wd <- setwd(path) 332s > stopifnot(identical(length(tags()), 1L)) 332s > tag_delete(name = "Tagname") 332s > stopifnot(identical(length(tags()), 0L)) 332s > if (!is.null(wd)) 332s + setwd(wd) 332s > 332s > ## Cleanup 332s > unlink(path, recursive = TRUE) 332s > 332s BEGIN TEST time.R 332s 332s R version 4.4.3 (2025-02-28) -- "Trophy Case" 332s Copyright (C) 2025 The R Foundation for Statistical Computing 332s Platform: aarch64-unknown-linux-gnu 332s 332s R is free software and comes with ABSOLUTELY NO WARRANTY. 332s You are welcome to redistribute it under certain conditions. 332s Type 'license()' or 'licence()' for distribution details. 332s 332s R is a collaborative project with many contributors. 332s Type 'contributors()' for more information and 332s 'citation()' on how to cite R or R packages in publications. 332s 332s Type 'demo()' for some demos, 'help()' for on-line help, or 332s 'help.start()' for an HTML browser interface to help. 332s Type 'q()' to quit R. 332s 332s > ## git2r, R bindings to the libgit2 library. 332s > ## Copyright (C) 2013-2023 The git2r contributors 332s > ## 332s > ## This program is free software; you can redistribute it and/or modify 332s > ## it under the terms of the GNU General Public License, version 2, 332s > ## as published by the Free Software Foundation. 332s > ## 332s > ## git2r is distributed in the hope that it will be useful, 332s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 332s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 332s > ## GNU General Public License for more details. 332s > ## 332s > ## You should have received a copy of the GNU General Public License along 332s > ## with this program; if not, write to the Free Software Foundation, Inc., 332s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 332s > 332s > library(git2r) 332s > 332s > ## For debugging 332s > sessionInfo() 332s R version 4.4.3 (2025-02-28) 332s Platform: aarch64-unknown-linux-gnu 332s Running under: Ubuntu Plucky Puffin (development branch) 332s 332s Matrix products: default 332s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 332s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 332s 332s locale: 332s [1] C 332s 332s time zone: Etc/UTC 332s tzcode source: system (glibc) 332s 332s attached base packages: 332s [1] stats graphics grDevices utils datasets methods base 332s 332s other attached packages: 332s [1] git2r_0.35.0 332s 332s loaded via a namespace (and not attached): 332s [1] compiler_4.4.3 332s > libgit2_version() 332s $major 332s [1] 1 332s 332s $minor 332s [1] 9 332s 332s $rev 332s [1] 0 332s 332s > libgit2_features() 332s $threads 332s [1] TRUE 332s 332s $https 332s [1] TRUE 332s 332s $ssh 332s [1] TRUE 332s 332s > 332s > 332s > ## Test to coerce 332s > git_t <- structure(list(time = 1395567947, offset = 60), 332s + class = "git_time") 332s > stopifnot(identical(as.character(git_t), "2014-03-23 09:45:47 GMT")) 332s > stopifnot(identical(as.character(git_t, usetz = FALSE), "2014-03-23 09:45:47")) 332s > stopifnot(identical(as.POSIXct(git_t), 332s + as.POSIXct(1395567947, tz = "GMT", origin = "1970-01-01"))) 332s > stopifnot(identical(print(git_t), git_t)) 332s 2014-03-23 09:45:47 GMT 332s > 332s > as.POSIXct(1395567947, origin = "1970-01-01", tz = "-03") 332s [1] "2014-03-23 09:45:47" 332s > 332s > ## Test that origin/tz can be passed to as.POSIXct 332s > stopifnot(identical(as.POSIXct(git_t, tz = "Europe/Stockholm", 332s + origin = "1980-02-02"), 332s + as.POSIXct(1395567947, tz = "Europe/Stockholm", 332s + origin = "1980-02-02"))) 332s > 332s > ## Test that origin/tz can be passed to as.character 332s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 332s + origin = "1980-02-02"), 332s + "2024-04-23 11:45:47 CEST")) 332s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 332s + origin = "1980-02-02", usetz = FALSE), 332s + "2024-04-23 11:45:47")) 332s > 332s > ## Test that origin/tz can be passed to print 332s > stopifnot(identical( 332s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 332s + origin = "1980-02-02")), 332s + "2024-04-23 11:45:47 CEST" 332s + )) 332s > stopifnot(identical( 332s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 332s + origin = "1980-02-02", usetz = FALSE)), 332s + "2024-04-23 11:45:47" 332s + )) 332s > 332s BEGIN TEST tree.R 332s 332s R version 4.4.3 (2025-02-28) -- "Trophy Case" 332s Copyright (C) 2025 The R Foundation for Statistical Computing 332s Platform: aarch64-unknown-linux-gnu 332s 332s R is free software and comes with ABSOLUTELY NO WARRANTY. 332s You are welcome to redistribute it under certain conditions. 332s Type 'license()' or 'licence()' for distribution details. 332s 332s R is a collaborative project with many contributors. 332s Type 'contributors()' for more information and 332s 'citation()' on how to cite R or R packages in publications. 332s 332s Type 'demo()' for some demos, 'help()' for on-line help, or 332s 'help.start()' for an HTML browser interface to help. 332s Type 'q()' to quit R. 332s 333s > ## git2r, R bindings to the libgit2 library. 333s > ## Copyright (C) 2013-2023 The git2r contributors 333s > ## 333s > ## This program is free software; you can redistribute it and/or modify 333s > ## it under the terms of the GNU General Public License, version 2, 333s > ## as published by the Free Software Foundation. 333s > ## 333s > ## git2r is distributed in the hope that it will be useful, 333s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 333s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 333s > ## GNU General Public License for more details. 333s > ## 333s > ## You should have received a copy of the GNU General Public License along 333s > ## with this program; if not, write to the Free Software Foundation, Inc., 333s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 333s > 333s > library("git2r") 333s > 333s > ## For debugging 333s > sessionInfo() 333s R version 4.4.3 (2025-02-28) 333s Platform: aarch64-unknown-linux-gnu 333s Running under: Ubuntu Plucky Puffin (development branch) 333s 333s Matrix products: default 333s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 333s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 333s 333s locale: 333s [1] C 333s 333s time zone: Etc/UTC 333s tzcode source: system (glibc) 333s 333s attached base packages: 333s [1] stats graphics grDevices utils datasets methods base 333s 333s other attached packages: 333s [1] git2r_0.35.0 333s 333s loaded via a namespace (and not attached): 333s [1] compiler_4.4.3 333s > libgit2_version() 333s $major 333s [1] 1 333s 333s $minor 333s [1] 9 333s 333s $rev 333s [1] 0 333s 333s > libgit2_features() 333s $threads 333s [1] TRUE 333s 333s $https 333s [1] TRUE 333s 333s $ssh 333s [1] TRUE 333s 333s > 333s > 333s > ## Create a directory in tempdir 333s > path <- tempfile(pattern = "git2r-") 333s > dir.create(path) 333s > 333s > ## Initialize a repository 333s > repo <- init(path) 333s > config(repo, user.name = "Alice", user.email = "alice@example.org") 333s > 333s > ## Create a file 333s > f <- file(file.path(path, "test.txt"), "wb") 333s > writeChar("Hello world!\n", f, eos = NULL) 333s > close(f) 333s > 333s > ## add and commit 333s > add(repo, "test.txt") 333s > commit(repo, "Commit message") 333s [e39ac52] 2025-03-15: Commit message 333s > 333s > ## Check tree 333s > stopifnot(is_tree(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"))) 333s > stopifnot(identical( 333s + sha(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")), 333s + "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")) 333s > stopifnot(is_tree(tree(commits(repo)[[1]]))) 333s > stopifnot(identical(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"), 333s + tree(commits(repo)[[1]]))) 333s > stopifnot(identical(length(tree(commits(repo)[[1]])), 1L)) 333s > 333s > ## Coerce to a data.frame and check column names 333s > stopifnot(identical(names(as.data.frame(tree(commits(repo)[[1]]))), 333s + c("mode", "type", "sha", "name"))) 333s > 333s > ## Coerce to list and check length 333s > stopifnot(identical(length(as.list(tree(last_commit(repo)))), 1L)) 333s > 333s > ## Print and summary 333s > stopifnot(identical(print(tree(last_commit(repo))), tree(last_commit(repo)))) 333s tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 333s 333s mode type sha name 333s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 333s > summary(tree(last_commit(repo))) 333s mode type sha name 333s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 333s > 333s > ## Check indexing 333s > stopifnot(is_blob(tree(last_commit(repo))[TRUE])) 333s > stopifnot(is_blob(tree(last_commit(repo))["test.txt"])) 333s > res <- tools::assertError(tree(last_commit(repo))[data.frame()]) 333s > stopifnot(length(grep("Invalid index", res[[1]]$message)) > 0) 333s > 333s > ## Check ls_tree 333s > stopifnot(identical(ls_tree(repo = repo), ls_tree(repo = path))) 333s > stopifnot(identical(ls_tree(tree = sha(tree(last_commit(repo))), repo = repo), 333s + ls_tree(repo = repo))) 333s > 333s > ## Cleanup 333s > unlink(path, recursive = TRUE) 333s > 333s BEGIN TEST when.R 333s 333s R version 4.4.3 (2025-02-28) -- "Trophy Case" 333s Copyright (C) 2025 The R Foundation for Statistical Computing 333s Platform: aarch64-unknown-linux-gnu 333s 333s R is free software and comes with ABSOLUTELY NO WARRANTY. 333s You are welcome to redistribute it under certain conditions. 333s Type 'license()' or 'licence()' for distribution details. 333s 333s R is a collaborative project with many contributors. 333s Type 'contributors()' for more information and 333s 'citation()' on how to cite R or R packages in publications. 333s 333s Type 'demo()' for some demos, 'help()' for on-line help, or 333s 'help.start()' for an HTML browser interface to help. 333s Type 'q()' to quit R. 333s 333s > ## git2r, R bindings to the libgit2 library. 333s > ## Copyright (C) 2013-2023 The git2r contributors 333s > ## 333s > ## This program is free software; you can redistribute it and/or modify 333s > ## it under the terms of the GNU General Public License, version 2, 333s > ## as published by the Free Software Foundation. 333s > ## 333s > ## git2r is distributed in the hope that it will be useful, 333s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 333s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 333s > ## GNU General Public License for more details. 333s > ## 333s > ## You should have received a copy of the GNU General Public License along 333s > ## with this program; if not, write to the Free Software Foundation, Inc., 333s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 333s > 333s > library("git2r") 333s > 333s > ## For debugging 333s > sessionInfo() 333s R version 4.4.3 (2025-02-28) 333s Platform: aarch64-unknown-linux-gnu 333s Running under: Ubuntu Plucky Puffin (development branch) 333s 333s Matrix products: default 333s BLAS: /usr/lib/aarch64-linux-gnu/blas/libblas.so.3.12.1 333s LAPACK: /usr/lib/aarch64-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 333s 333s locale: 333s [1] C 333s 333s time zone: Etc/UTC 333s tzcode source: system (glibc) 333s 333s attached base packages: 333s [1] stats graphics grDevices utils datasets methods base 333s 333s other attached packages: 333s [1] git2r_0.35.0 333s 333s loaded via a namespace (and not attached): 333s [1] compiler_4.4.3 333s > libgit2_version() 333s $major 333s [1] 1 333s 333s $minor 333s [1] 9 333s 333s $rev 333s [1] 0 333s 333s > libgit2_features() 333s $threads 333s [1] TRUE 333s 333s $https 333s [1] TRUE 333s 333s $ssh 333s [1] TRUE 333s 333s > 333s > 333s > ## Check when method 333s > w1 <- structure(list(time = 1395567947, offset = 60), 333s + class = "git_time") 333s > stopifnot(identical(when(w1), "2014-03-23 09:45:47 GMT")) 333s > stopifnot(identical(when(w1, usetz = FALSE), "2014-03-23 09:45:47")) 333s > stopifnot(identical(when(w1, tz = "Europe/Stockholm", origin = "1980-02-02"), 333s + "2024-04-23 11:45:47 CEST")) 333s > 333s > s1 <- structure(list(name = "Alice", email = "alice@example.org", when = w1), 333s + class = "git_signature") 333s > stopifnot(identical(when(s1), "2014-03-23 09:45:47 GMT")) 333s > stopifnot(identical(when(s1, usetz = FALSE), "2014-03-23 09:45:47")) 333s > stopifnot(identical(when(s1, tz = "Europe/Stockholm", origin = "1980-02-02"), 333s + "2024-04-23 11:45:47 CEST")) 333s > 333s > w2 <- structure(list(time = 1395567950, offset = 60), 333s + class = "git_time") 333s > s2 <- structure(list(name = "Alice", email = "alice@example.org", when = w2), 333s + class = "git_signature") 333s > c1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 333s + author = s1, 333s + committer = s2, 333s + summary = "A commit summary", 333s + message = "A commit message"), 333s + class = "git_commit") 333s > stopifnot(identical(when(c1), "2014-03-23 09:45:47 GMT")) 333s > stopifnot(identical(when(c1, usetz = FALSE), "2014-03-23 09:45:47")) 333s > stopifnot(identical(when(c1, tz = "Europe/Stockholm", origin = "1980-02-02"), 333s + "2024-04-23 11:45:47 CEST")) 333s > 333s > t1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 333s + message = "A tag message", 333s + name = "A tage name", 333s + tagger = s1, 333s + target = "166f3f779fd7e4165aaa43f2828050ce040052b0"), 333s + class = "git_tag") 333s > stopifnot(identical(when(t1), "2014-03-23 09:45:47 GMT")) 333s > stopifnot(identical(when(t1, usetz = FALSE), "2014-03-23 09:45:47")) 333s > stopifnot(identical(when(t1, tz = "Europe/Stockholm", origin = "1980-02-02"), 333s + "2024-04-23 11:45:47 CEST")) 333s > 333s autopkgtest [14:47:53]: test run-unit-test: -----------------------] 334s autopkgtest [14:47:54]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 334s run-unit-test PASS 334s autopkgtest [14:47:54]: test pkg-r-autopkgtest: preparing testbed 334s Reading package lists... 335s Building dependency tree... 335s Reading state information... 335s Starting pkgProblemResolver with broken count: 0 335s Starting 2 pkgProblemResolver with broken count: 0 335s Done 336s The following NEW packages will be installed: 336s build-essential cpp cpp-14 cpp-14-aarch64-linux-gnu cpp-aarch64-linux-gnu 336s dctrl-tools g++ g++-14 g++-14-aarch64-linux-gnu g++-aarch64-linux-gnu gcc 336s gcc-14 gcc-14-aarch64-linux-gnu gcc-aarch64-linux-gnu gfortran gfortran-14 336s gfortran-14-aarch64-linux-gnu gfortran-aarch64-linux-gnu icu-devtools 336s libasan8 libblas-dev libbz2-dev libcc1-0 libdeflate-dev libgcc-14-dev 336s libgfortran-14-dev libhwasan0 libicu-dev libisl23 libitm1 libjpeg-dev 336s libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblsan0 liblzma-dev libmpc3 336s libncurses-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 336s libpkgconf3 libpng-dev libreadline-dev libstdc++-14-dev libtirpc-dev 336s libtsan2 libubsan1 pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev 336s zlib1g-dev 336s 0 upgraded, 54 newly installed, 0 to remove and 0 not upgraded. 336s Need to get 92.7 MB of archives. 336s After this operation, 334 MB of additional disk space will be used. 336s Get:1 http://ftpmaster.internal/ubuntu plucky/main arm64 libisl23 arm64 0.27-1 [676 kB] 337s Get:2 http://ftpmaster.internal/ubuntu plucky/main arm64 libmpc3 arm64 1.3.1-1build2 [56.8 kB] 337s Get:3 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [10.6 MB] 349s Get:4 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-14 arm64 14.2.0-17ubuntu3 [1028 B] 349s Get:5 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [5558 B] 349s Get:6 http://ftpmaster.internal/ubuntu plucky/main arm64 cpp arm64 4:14.2.0-1ubuntu1 [22.4 kB] 349s Get:7 http://ftpmaster.internal/ubuntu plucky/main arm64 libcc1-0 arm64 15-20250222-0ubuntu1 [44.2 kB] 349s Get:8 http://ftpmaster.internal/ubuntu plucky/main arm64 libitm1 arm64 15-20250222-0ubuntu1 [28.0 kB] 349s Get:9 http://ftpmaster.internal/ubuntu plucky/main arm64 libasan8 arm64 15-20250222-0ubuntu1 [2924 kB] 352s Get:10 http://ftpmaster.internal/ubuntu plucky/main arm64 liblsan0 arm64 15-20250222-0ubuntu1 [1319 kB] 354s Get:11 http://ftpmaster.internal/ubuntu plucky/main arm64 libtsan2 arm64 15-20250222-0ubuntu1 [2694 kB] 357s Get:12 http://ftpmaster.internal/ubuntu plucky/main arm64 libubsan1 arm64 15-20250222-0ubuntu1 [1178 kB] 358s Get:13 http://ftpmaster.internal/ubuntu plucky/main arm64 libhwasan0 arm64 15-20250222-0ubuntu1 [1642 kB] 359s Get:14 http://ftpmaster.internal/ubuntu plucky/main arm64 libgcc-14-dev arm64 14.2.0-17ubuntu3 [2593 kB] 362s Get:15 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [20.9 MB] 385s Get:16 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-14 arm64 14.2.0-17ubuntu3 [526 kB] 386s Get:17 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [1200 B] 386s Get:18 http://ftpmaster.internal/ubuntu plucky/main arm64 gcc arm64 4:14.2.0-1ubuntu1 [4998 B] 386s Get:19 http://ftpmaster.internal/ubuntu plucky/main arm64 libstdc++-14-dev arm64 14.2.0-17ubuntu3 [2499 kB] 388s Get:20 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [12.1 MB] 401s Get:21 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-14 arm64 14.2.0-17ubuntu3 [21.8 kB] 401s Get:22 http://ftpmaster.internal/ubuntu plucky/main arm64 g++-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [956 B] 401s Get:23 http://ftpmaster.internal/ubuntu plucky/main arm64 g++ arm64 4:14.2.0-1ubuntu1 [1080 B] 401s Get:24 http://ftpmaster.internal/ubuntu plucky/main arm64 build-essential arm64 12.10ubuntu1 [4932 B] 401s Get:25 http://ftpmaster.internal/ubuntu plucky/main arm64 dctrl-tools arm64 2.24-3build3 [103 kB] 401s Get:26 http://ftpmaster.internal/ubuntu plucky/main arm64 libgfortran-14-dev arm64 14.2.0-17ubuntu3 [498 kB] 402s Get:27 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-14-aarch64-linux-gnu arm64 14.2.0-17ubuntu3 [11.4 MB] 415s Get:28 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-14 arm64 14.2.0-17ubuntu3 [13.6 kB] 415s Get:29 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran-aarch64-linux-gnu arm64 4:14.2.0-1ubuntu1 [1022 B] 415s Get:30 http://ftpmaster.internal/ubuntu plucky/main arm64 gfortran arm64 4:14.2.0-1ubuntu1 [1166 B] 415s Get:31 http://ftpmaster.internal/ubuntu plucky/main arm64 icu-devtools arm64 76.1-1ubuntu2 [213 kB] 415s Get:32 http://ftpmaster.internal/ubuntu plucky/main arm64 libblas-dev arm64 3.12.1-2 [126 kB] 415s Get:33 http://ftpmaster.internal/ubuntu plucky/main arm64 libbz2-dev arm64 1.0.8-6 [36.1 kB] 415s Get:34 http://ftpmaster.internal/ubuntu plucky/main arm64 libdeflate-dev arm64 1.23-1 [53.7 kB] 415s Get:35 http://ftpmaster.internal/ubuntu plucky/main arm64 libicu-dev arm64 76.1-1ubuntu2 [12.2 MB] 429s Get:36 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-turbo8-dev arm64 2.1.5-3ubuntu2 [306 kB] 429s Get:37 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg8-dev arm64 8c-2ubuntu11 [1484 B] 429s Get:38 http://ftpmaster.internal/ubuntu plucky/main arm64 libjpeg-dev arm64 8c-2ubuntu11 [1482 B] 429s Get:39 http://ftpmaster.internal/ubuntu plucky/main arm64 liblapack-dev arm64 3.12.1-2 [4439 kB] 434s Get:40 http://ftpmaster.internal/ubuntu plucky/main arm64 libncurses-dev arm64 6.5+20250216-2 [389 kB] 435s Get:41 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-16-0 arm64 10.45-1 [222 kB] 435s Get:42 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-32-0 arm64 10.45-1 [210 kB] 435s Get:43 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-posix3 arm64 10.45-1 [7084 B] 435s Get:44 http://ftpmaster.internal/ubuntu plucky/main arm64 libpcre2-dev arm64 10.45-1 [768 kB] 436s Get:45 http://ftpmaster.internal/ubuntu plucky/main arm64 libpkgconf3 arm64 1.8.1-4 [31.4 kB] 436s Get:46 http://ftpmaster.internal/ubuntu plucky/main arm64 zlib1g-dev arm64 1:1.3.dfsg+really1.3.1-1ubuntu1 [894 kB] 437s Get:47 http://ftpmaster.internal/ubuntu plucky/main arm64 libpng-dev arm64 1.6.47-1 [269 kB] 437s Get:48 http://ftpmaster.internal/ubuntu plucky/main arm64 libreadline-dev arm64 8.2-6 [179 kB] 437s Get:49 http://ftpmaster.internal/ubuntu plucky/main arm64 liblzma-dev arm64 5.6.4-1 [180 kB] 438s Get:50 http://ftpmaster.internal/ubuntu plucky/main arm64 pkgconf-bin arm64 1.8.1-4 [20.9 kB] 438s Get:51 http://ftpmaster.internal/ubuntu plucky/main arm64 pkgconf arm64 1.8.1-4 [16.7 kB] 438s Get:52 http://ftpmaster.internal/ubuntu plucky/main arm64 libtirpc-dev arm64 1.3.4+ds-1.3 [201 kB] 438s Get:53 http://ftpmaster.internal/ubuntu plucky/universe arm64 r-base-dev all 4.4.3-1 [4176 B] 438s Get:54 http://ftpmaster.internal/ubuntu plucky/universe arm64 pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 439s Fetched 92.7 MB in 1min 42s (910 kB/s) 439s Selecting previously unselected package libisl23:arm64. 439s (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 83900 files and directories currently installed.) 439s Preparing to unpack .../00-libisl23_0.27-1_arm64.deb ... 439s Unpacking libisl23:arm64 (0.27-1) ... 439s Selecting previously unselected package libmpc3:arm64. 439s Preparing to unpack .../01-libmpc3_1.3.1-1build2_arm64.deb ... 439s Unpacking libmpc3:arm64 (1.3.1-1build2) ... 439s Selecting previously unselected package cpp-14-aarch64-linux-gnu. 439s Preparing to unpack .../02-cpp-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 439s Unpacking cpp-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 439s Selecting previously unselected package cpp-14. 439s Preparing to unpack .../03-cpp-14_14.2.0-17ubuntu3_arm64.deb ... 439s Unpacking cpp-14 (14.2.0-17ubuntu3) ... 439s Selecting previously unselected package cpp-aarch64-linux-gnu. 439s Preparing to unpack .../04-cpp-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 439s Unpacking cpp-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 440s Selecting previously unselected package cpp. 440s Preparing to unpack .../05-cpp_4%3a14.2.0-1ubuntu1_arm64.deb ... 440s Unpacking cpp (4:14.2.0-1ubuntu1) ... 440s Selecting previously unselected package libcc1-0:arm64. 440s Preparing to unpack .../06-libcc1-0_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libcc1-0:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libitm1:arm64. 440s Preparing to unpack .../07-libitm1_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libitm1:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libasan8:arm64. 440s Preparing to unpack .../08-libasan8_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libasan8:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package liblsan0:arm64. 440s Preparing to unpack .../09-liblsan0_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking liblsan0:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libtsan2:arm64. 440s Preparing to unpack .../10-libtsan2_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libtsan2:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libubsan1:arm64. 440s Preparing to unpack .../11-libubsan1_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libubsan1:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libhwasan0:arm64. 440s Preparing to unpack .../12-libhwasan0_15-20250222-0ubuntu1_arm64.deb ... 440s Unpacking libhwasan0:arm64 (15-20250222-0ubuntu1) ... 440s Selecting previously unselected package libgcc-14-dev:arm64. 440s Preparing to unpack .../13-libgcc-14-dev_14.2.0-17ubuntu3_arm64.deb ... 440s Unpacking libgcc-14-dev:arm64 (14.2.0-17ubuntu3) ... 441s Selecting previously unselected package gcc-14-aarch64-linux-gnu. 441s Preparing to unpack .../14-gcc-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 441s Unpacking gcc-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 441s Selecting previously unselected package gcc-14. 441s Preparing to unpack .../15-gcc-14_14.2.0-17ubuntu3_arm64.deb ... 441s Unpacking gcc-14 (14.2.0-17ubuntu3) ... 441s Selecting previously unselected package gcc-aarch64-linux-gnu. 441s Preparing to unpack .../16-gcc-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 441s Unpacking gcc-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 441s Selecting previously unselected package gcc. 442s Preparing to unpack .../17-gcc_4%3a14.2.0-1ubuntu1_arm64.deb ... 442s Unpacking gcc (4:14.2.0-1ubuntu1) ... 442s Selecting previously unselected package libstdc++-14-dev:arm64. 442s Preparing to unpack .../18-libstdc++-14-dev_14.2.0-17ubuntu3_arm64.deb ... 442s Unpacking libstdc++-14-dev:arm64 (14.2.0-17ubuntu3) ... 442s Selecting previously unselected package g++-14-aarch64-linux-gnu. 442s Preparing to unpack .../19-g++-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 442s Unpacking g++-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 442s Selecting previously unselected package g++-14. 442s Preparing to unpack .../20-g++-14_14.2.0-17ubuntu3_arm64.deb ... 442s Unpacking g++-14 (14.2.0-17ubuntu3) ... 442s Selecting previously unselected package g++-aarch64-linux-gnu. 442s Preparing to unpack .../21-g++-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 442s Unpacking g++-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 442s Selecting previously unselected package g++. 442s Preparing to unpack .../22-g++_4%3a14.2.0-1ubuntu1_arm64.deb ... 442s Unpacking g++ (4:14.2.0-1ubuntu1) ... 443s Selecting previously unselected package build-essential. 443s Preparing to unpack .../23-build-essential_12.10ubuntu1_arm64.deb ... 443s Unpacking build-essential (12.10ubuntu1) ... 443s Selecting previously unselected package dctrl-tools. 443s Preparing to unpack .../24-dctrl-tools_2.24-3build3_arm64.deb ... 443s Unpacking dctrl-tools (2.24-3build3) ... 443s Selecting previously unselected package libgfortran-14-dev:arm64. 443s Preparing to unpack .../25-libgfortran-14-dev_14.2.0-17ubuntu3_arm64.deb ... 443s Unpacking libgfortran-14-dev:arm64 (14.2.0-17ubuntu3) ... 443s Selecting previously unselected package gfortran-14-aarch64-linux-gnu. 443s Preparing to unpack .../26-gfortran-14-aarch64-linux-gnu_14.2.0-17ubuntu3_arm64.deb ... 443s Unpacking gfortran-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 443s Selecting previously unselected package gfortran-14. 443s Preparing to unpack .../27-gfortran-14_14.2.0-17ubuntu3_arm64.deb ... 443s Unpacking gfortran-14 (14.2.0-17ubuntu3) ... 443s Selecting previously unselected package gfortran-aarch64-linux-gnu. 443s Preparing to unpack .../28-gfortran-aarch64-linux-gnu_4%3a14.2.0-1ubuntu1_arm64.deb ... 443s Unpacking gfortran-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 443s Selecting previously unselected package gfortran. 443s Preparing to unpack .../29-gfortran_4%3a14.2.0-1ubuntu1_arm64.deb ... 443s Unpacking gfortran (4:14.2.0-1ubuntu1) ... 443s Selecting previously unselected package icu-devtools. 443s Preparing to unpack .../30-icu-devtools_76.1-1ubuntu2_arm64.deb ... 443s Unpacking icu-devtools (76.1-1ubuntu2) ... 443s Selecting previously unselected package libblas-dev:arm64. 444s Preparing to unpack .../31-libblas-dev_3.12.1-2_arm64.deb ... 444s Unpacking libblas-dev:arm64 (3.12.1-2) ... 444s Selecting previously unselected package libbz2-dev:arm64. 444s Preparing to unpack .../32-libbz2-dev_1.0.8-6_arm64.deb ... 444s Unpacking libbz2-dev:arm64 (1.0.8-6) ... 444s Selecting previously unselected package libdeflate-dev:arm64. 444s Preparing to unpack .../33-libdeflate-dev_1.23-1_arm64.deb ... 444s Unpacking libdeflate-dev:arm64 (1.23-1) ... 444s Selecting previously unselected package libicu-dev:arm64. 444s Preparing to unpack .../34-libicu-dev_76.1-1ubuntu2_arm64.deb ... 444s Unpacking libicu-dev:arm64 (76.1-1ubuntu2) ... 444s Selecting previously unselected package libjpeg-turbo8-dev:arm64. 444s Preparing to unpack .../35-libjpeg-turbo8-dev_2.1.5-3ubuntu2_arm64.deb ... 444s Unpacking libjpeg-turbo8-dev:arm64 (2.1.5-3ubuntu2) ... 444s Selecting previously unselected package libjpeg8-dev:arm64. 444s Preparing to unpack .../36-libjpeg8-dev_8c-2ubuntu11_arm64.deb ... 444s Unpacking libjpeg8-dev:arm64 (8c-2ubuntu11) ... 444s Selecting previously unselected package libjpeg-dev:arm64. 444s Preparing to unpack .../37-libjpeg-dev_8c-2ubuntu11_arm64.deb ... 444s Unpacking libjpeg-dev:arm64 (8c-2ubuntu11) ... 444s Selecting previously unselected package liblapack-dev:arm64. 444s Preparing to unpack .../38-liblapack-dev_3.12.1-2_arm64.deb ... 444s Unpacking liblapack-dev:arm64 (3.12.1-2) ... 445s Selecting previously unselected package libncurses-dev:arm64. 445s Preparing to unpack .../39-libncurses-dev_6.5+20250216-2_arm64.deb ... 445s Unpacking libncurses-dev:arm64 (6.5+20250216-2) ... 445s Selecting previously unselected package libpcre2-16-0:arm64. 445s Preparing to unpack .../40-libpcre2-16-0_10.45-1_arm64.deb ... 445s Unpacking libpcre2-16-0:arm64 (10.45-1) ... 445s Selecting previously unselected package libpcre2-32-0:arm64. 445s Preparing to unpack .../41-libpcre2-32-0_10.45-1_arm64.deb ... 445s Unpacking libpcre2-32-0:arm64 (10.45-1) ... 445s Selecting previously unselected package libpcre2-posix3:arm64. 445s Preparing to unpack .../42-libpcre2-posix3_10.45-1_arm64.deb ... 445s Unpacking libpcre2-posix3:arm64 (10.45-1) ... 445s Selecting previously unselected package libpcre2-dev:arm64. 445s Preparing to unpack .../43-libpcre2-dev_10.45-1_arm64.deb ... 445s Unpacking libpcre2-dev:arm64 (10.45-1) ... 445s Selecting previously unselected package libpkgconf3:arm64. 445s Preparing to unpack .../44-libpkgconf3_1.8.1-4_arm64.deb ... 445s Unpacking libpkgconf3:arm64 (1.8.1-4) ... 445s Selecting previously unselected package zlib1g-dev:arm64. 445s Preparing to unpack .../45-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_arm64.deb ... 445s Unpacking zlib1g-dev:arm64 (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 445s Selecting previously unselected package libpng-dev:arm64. 445s Preparing to unpack .../46-libpng-dev_1.6.47-1_arm64.deb ... 445s Unpacking libpng-dev:arm64 (1.6.47-1) ... 445s Selecting previously unselected package libreadline-dev:arm64. 445s Preparing to unpack .../47-libreadline-dev_8.2-6_arm64.deb ... 445s Unpacking libreadline-dev:arm64 (8.2-6) ... 445s Selecting previously unselected package liblzma-dev:arm64. 445s Preparing to unpack .../48-liblzma-dev_5.6.4-1_arm64.deb ... 445s Unpacking liblzma-dev:arm64 (5.6.4-1) ... 446s Selecting previously unselected package pkgconf-bin. 446s Preparing to unpack .../49-pkgconf-bin_1.8.1-4_arm64.deb ... 446s Unpacking pkgconf-bin (1.8.1-4) ... 446s Selecting previously unselected package pkgconf:arm64. 446s Preparing to unpack .../50-pkgconf_1.8.1-4_arm64.deb ... 446s Unpacking pkgconf:arm64 (1.8.1-4) ... 446s Selecting previously unselected package libtirpc-dev:arm64. 446s Preparing to unpack .../51-libtirpc-dev_1.3.4+ds-1.3_arm64.deb ... 446s Unpacking libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 446s Selecting previously unselected package r-base-dev. 446s Preparing to unpack .../52-r-base-dev_4.4.3-1_all.deb ... 446s Unpacking r-base-dev (4.4.3-1) ... 446s Selecting previously unselected package pkg-r-autopkgtest. 446s Preparing to unpack .../53-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 446s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 446s Setting up libjpeg-turbo8-dev:arm64 (2.1.5-3ubuntu2) ... 446s Setting up libncurses-dev:arm64 (6.5+20250216-2) ... 446s Setting up libreadline-dev:arm64 (8.2-6) ... 446s Setting up libpcre2-16-0:arm64 (10.45-1) ... 446s Setting up libpcre2-32-0:arm64 (10.45-1) ... 446s Setting up libtirpc-dev:arm64 (1.3.4+ds-1.3) ... 446s Setting up libpkgconf3:arm64 (1.8.1-4) ... 446s Setting up libmpc3:arm64 (1.3.1-1build2) ... 446s Setting up icu-devtools (76.1-1ubuntu2) ... 446s Setting up pkgconf-bin (1.8.1-4) ... 446s Setting up liblzma-dev:arm64 (5.6.4-1) ... 446s Setting up libubsan1:arm64 (15-20250222-0ubuntu1) ... 446s Setting up zlib1g-dev:arm64 (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 446s Setting up libpcre2-posix3:arm64 (10.45-1) ... 446s Setting up libhwasan0:arm64 (15-20250222-0ubuntu1) ... 446s Setting up libasan8:arm64 (15-20250222-0ubuntu1) ... 446s Setting up libtsan2:arm64 (15-20250222-0ubuntu1) ... 446s Setting up libjpeg8-dev:arm64 (8c-2ubuntu11) ... 446s Setting up libisl23:arm64 (0.27-1) ... 446s Setting up libdeflate-dev:arm64 (1.23-1) ... 446s Setting up libicu-dev:arm64 (76.1-1ubuntu2) ... 446s Setting up libcc1-0:arm64 (15-20250222-0ubuntu1) ... 446s Setting up liblsan0:arm64 (15-20250222-0ubuntu1) ... 446s Setting up libblas-dev:arm64 (3.12.1-2) ... 446s update-alternatives: using /usr/lib/aarch64-linux-gnu/blas/libblas.so to provide /usr/lib/aarch64-linux-gnu/libblas.so (libblas.so-aarch64-linux-gnu) in auto mode 446s Setting up dctrl-tools (2.24-3build3) ... 446s Setting up libitm1:arm64 (15-20250222-0ubuntu1) ... 446s Setting up libbz2-dev:arm64 (1.0.8-6) ... 446s Setting up libpcre2-dev:arm64 (10.45-1) ... 446s Setting up libpng-dev:arm64 (1.6.47-1) ... 446s Setting up libjpeg-dev:arm64 (8c-2ubuntu11) ... 446s Setting up pkgconf:arm64 (1.8.1-4) ... 446s Setting up liblapack-dev:arm64 (3.12.1-2) ... 446s update-alternatives: using /usr/lib/aarch64-linux-gnu/lapack/liblapack.so to provide /usr/lib/aarch64-linux-gnu/liblapack.so (liblapack.so-aarch64-linux-gnu) in auto mode 446s Setting up cpp-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 446s Setting up libgcc-14-dev:arm64 (14.2.0-17ubuntu3) ... 446s Setting up libstdc++-14-dev:arm64 (14.2.0-17ubuntu3) ... 446s Setting up libgfortran-14-dev:arm64 (14.2.0-17ubuntu3) ... 446s Setting up cpp-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 446s Setting up cpp-14 (14.2.0-17ubuntu3) ... 446s Setting up cpp (4:14.2.0-1ubuntu1) ... 446s Setting up gcc-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 446s Setting up gcc-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 446s Setting up g++-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 446s Setting up gcc-14 (14.2.0-17ubuntu3) ... 446s Setting up gfortran-14-aarch64-linux-gnu (14.2.0-17ubuntu3) ... 446s Setting up g++-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 446s Setting up gfortran-aarch64-linux-gnu (4:14.2.0-1ubuntu1) ... 446s Setting up g++-14 (14.2.0-17ubuntu3) ... 446s Setting up gfortran-14 (14.2.0-17ubuntu3) ... 446s Setting up gcc (4:14.2.0-1ubuntu1) ... 446s Setting up g++ (4:14.2.0-1ubuntu1) ... 446s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 446s Setting up build-essential (12.10ubuntu1) ... 446s Setting up gfortran (4:14.2.0-1ubuntu1) ... 446s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 446s update-alternatives: warning: skip creation of /usr/share/man/man1/f95.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f95) doesn't exist 446s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 446s update-alternatives: warning: skip creation of /usr/share/man/man1/f77.1.gz because associated file /usr/share/man/man1/gfortran.1.gz (of link group f77) doesn't exist 446s Setting up r-base-dev (4.4.3-1) ... 446s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 446s Processing triggers for libc-bin (2.41-1ubuntu2) ... 446s Processing triggers for man-db (2.13.0-1) ... 447s Processing triggers for install-info (7.1.1-1) ... 449s autopkgtest [14:49:49]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 449s autopkgtest [14:49:49]: test pkg-r-autopkgtest: [----------------------- 449s Test: Try to load the R library git2r 449s 449s R version 4.4.3 (2025-02-28) -- "Trophy Case" 449s Copyright (C) 2025 The R Foundation for Statistical Computing 449s Platform: aarch64-unknown-linux-gnu 449s 449s R is free software and comes with ABSOLUTELY NO WARRANTY. 449s You are welcome to redistribute it under certain conditions. 449s Type 'license()' or 'licence()' for distribution details. 449s 449s R is a collaborative project with many contributors. 449s Type 'contributors()' for more information and 449s 'citation()' on how to cite R or R packages in publications. 449s 449s Type 'demo()' for some demos, 'help()' for on-line help, or 449s 'help.start()' for an HTML browser interface to help. 449s Type 'q()' to quit R. 449s 449s > library('git2r') 449s > 449s > 449s Other tests are currently unsupported! 449s They will be progressively added. 450s autopkgtest [14:49:50]: test pkg-r-autopkgtest: -----------------------] 450s autopkgtest [14:49:50]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 450s pkg-r-autopkgtest PASS 451s autopkgtest [14:49:51]: @@@@@@@@@@@@@@@@@@@@ summary 451s run-unit-test PASS 451s pkg-r-autopkgtest PASS 468s nova [W] Using flock in prodstack6-arm64 468s Creating nova instance adt-plucky-arm64-r-cran-git2r-20250315-144219-juju-7f2275-prod-proposed-migration-environment-2-ee914b27-c431-4db9-aaf0-20284814bd08 from image adt/ubuntu-plucky-arm64-server-20250315.img (UUID bd6e766c-b51f-4b53-86d6-23aa4d18f524)... 468s nova [W] Timed out waiting for 3eb1b857-e047-4e91-8a53-ec102453828d to get deleted.