0s autopkgtest [16:10:29]: starting date and time: 2025-03-15 16:10:29+0000 0s autopkgtest [16:10:29]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [16:10:29]: host juju-7f2275-prod-proposed-migration-environment-9; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.pjia3j3w/out --timeout-copy=6000 --setup-commands 'ln -s /dev/null /etc/systemd/system/bluetooth.service; printf "http_proxy=http://squid.internal:3128\nhttps_proxy=http://squid.internal:3128\nno_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\n" >> /etc/environment' --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 -- lxd -r lxd-armhf-10.145.243.58 lxd-armhf-10.145.243.58:autopkgtest/ubuntu/plucky/armhf 20s autopkgtest [16:10:49]: testbed dpkg architecture: armhf 22s autopkgtest [16:10:51]: testbed apt version: 2.9.33 26s autopkgtest [16:10:55]: @@@@@@@@@@@@@@@@@@@@ test bed setup 28s autopkgtest [16:10:57]: testbed release detected to be: None 35s autopkgtest [16:11:04]: updating testbed package index (apt update) 37s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [126 kB] 37s Get:2 http://ftpmaster.internal/ubuntu plucky InRelease [257 kB] 38s Get:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease [126 kB] 38s Get:4 http://ftpmaster.internal/ubuntu plucky-security InRelease [126 kB] 38s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [379 kB] 39s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.8 kB] 39s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [99.7 kB] 39s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf Packages [114 kB] 39s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf c-n-f Metadata [1832 B] 39s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted armhf c-n-f Metadata [116 B] 39s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf Packages [312 kB] 39s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/universe armhf c-n-f Metadata [11.1 kB] 39s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf Packages [3472 B] 39s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse armhf c-n-f Metadata [240 B] 39s Get:15 http://ftpmaster.internal/ubuntu plucky/multiverse Sources [299 kB] 40s Get:16 http://ftpmaster.internal/ubuntu plucky/main Sources [1394 kB] 42s Get:17 http://ftpmaster.internal/ubuntu plucky/universe Sources [21.0 MB] 68s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf Packages [1378 kB] 69s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf c-n-f Metadata [29.4 kB] 69s Get:20 http://ftpmaster.internal/ubuntu plucky/restricted armhf c-n-f Metadata [108 B] 69s Get:21 http://ftpmaster.internal/ubuntu plucky/universe armhf Packages [15.1 MB] 87s Get:22 http://ftpmaster.internal/ubuntu plucky/multiverse armhf Packages [172 kB] 89s Fetched 41.0 MB in 52s (789 kB/s) 91s Reading package lists... 96s autopkgtest [16:12:05]: upgrading testbed (apt dist-upgrade and autopurge) 98s Reading package lists... 98s Building dependency tree... 98s Reading state information... 99s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 99s Starting 2 pkgProblemResolver with broken count: 0 99s Done 102s Entering ResolveByKeep 102s 102s Calculating upgrade... 102s The following packages will be upgraded: 102s libc-bin libc6 locales pinentry-curses python3-jinja2 sos strace 102s 7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 102s Need to get 8683 kB of archives. 102s After this operation, 23.6 kB of additional disk space will be used. 102s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf libc6 armhf 2.41-1ubuntu2 [2932 kB] 106s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf libc-bin armhf 2.41-1ubuntu2 [545 kB] 106s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf locales all 2.41-1ubuntu2 [4246 kB] 111s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf strace armhf 6.13+ds-1ubuntu1 [445 kB] 112s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf pinentry-curses armhf 1.3.1-2ubuntu3 [40.6 kB] 112s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf python3-jinja2 all 3.1.5-2ubuntu1 [109 kB] 112s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf sos all 4.9.0-5 [365 kB] 113s Preconfiguring packages ... 113s Fetched 8683 kB in 11s (807 kB/s) 113s (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 ... 64655 files and directories currently installed.) 113s Preparing to unpack .../libc6_2.41-1ubuntu2_armhf.deb ... 113s Unpacking libc6:armhf (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 113s Setting up libc6:armhf (2.41-1ubuntu2) ... 114s (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 ... 64655 files and directories currently installed.) 114s Preparing to unpack .../libc-bin_2.41-1ubuntu2_armhf.deb ... 114s Unpacking libc-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 114s Setting up libc-bin (2.41-1ubuntu2) ... 114s (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 ... 64655 files and directories currently installed.) 114s Preparing to unpack .../locales_2.41-1ubuntu2_all.deb ... 114s Unpacking locales (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 114s Preparing to unpack .../strace_6.13+ds-1ubuntu1_armhf.deb ... 114s Unpacking strace (6.13+ds-1ubuntu1) over (6.11-0ubuntu1) ... 114s Preparing to unpack .../pinentry-curses_1.3.1-2ubuntu3_armhf.deb ... 114s Unpacking pinentry-curses (1.3.1-2ubuntu3) over (1.3.1-2ubuntu2) ... 114s Preparing to unpack .../python3-jinja2_3.1.5-2ubuntu1_all.deb ... 114s Unpacking python3-jinja2 (3.1.5-2ubuntu1) over (3.1.5-2) ... 114s Preparing to unpack .../archives/sos_4.9.0-5_all.deb ... 115s Unpacking sos (4.9.0-5) over (4.9.0-4) ... 115s Setting up sos (4.9.0-5) ... 115s Setting up pinentry-curses (1.3.1-2ubuntu3) ... 115s Setting up locales (2.41-1ubuntu2) ... 116s Generating locales (this might take a while)... 119s en_US.UTF-8... done 119s Generation complete. 119s Setting up python3-jinja2 (3.1.5-2ubuntu1) ... 119s Setting up strace (6.13+ds-1ubuntu1) ... 119s Processing triggers for man-db (2.13.0-1) ... 120s Processing triggers for systemd (257.3-1ubuntu3) ... 122s Reading package lists... 123s Building dependency tree... 123s Reading state information... 123s Starting pkgProblemResolver with broken count: 0 123s Starting 2 pkgProblemResolver with broken count: 0 123s Done 124s Solving dependencies... 124s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 126s autopkgtest [16:12:35]: rebooting testbed after setup commands that affected boot 167s autopkgtest [16:13:16]: testbed running kernel: Linux 6.8.0-52-generic #53~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 15 18:10:51 UTC 2 198s autopkgtest [16:13:47]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-git2r 208s Get:1 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (dsc) [2100 B] 208s Get:2 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (tar) [237 kB] 208s Get:3 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (diff) [3100 B] 208s gpgv: Signature made Sat Feb 22 06:18:41 2025 UTC 208s gpgv: using RSA key 5C7ABEA20F8630459CC8C8B5E27F2CF8458C2FA4 208s gpgv: Can't check signature: No public key 208s dpkg-source: warning: cannot verify inline signature for ./r-cran-git2r_0.35.0-1build1.dsc: no acceptable signature found 208s autopkgtest [16:13:57]: testing package r-cran-git2r version 0.35.0-1build1 210s autopkgtest [16:13:59]: build not needed 214s autopkgtest [16:14:03]: test run-unit-test: preparing testbed 215s Reading package lists... 216s Building dependency tree... 216s Reading state information... 216s Starting pkgProblemResolver with broken count: 0 216s Starting 2 pkgProblemResolver with broken count: 0 216s Done 217s The following NEW packages will be installed: 217s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono libblas3 217s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libfreetype6 libgfortran5 217s libgit2-1.9 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 217s libjpeg-turbo8 libjpeg8 liblapack3 liblerc4 libpango-1.0-0 217s libpangocairo-1.0-0 libpangoft2-1.0-0 libpaper-utils libpaper2 libpixman-1-0 217s libsharpyuv0 libsm6 libtcl8.6 libthai-data libthai0 libtiff6 libtk8.6 217s libwebp7 libxcb-render0 libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 217s r-base-core r-cran-git2r unzip x11-common xdg-utils zip 218s 0 upgraded, 47 newly installed, 0 to remove and 0 not upgraded. 218s Need to get 38.5 MB of archives. 218s After this operation, 72.0 MB of additional disk space will be used. 218s Get:1 http://ftpmaster.internal/ubuntu plucky/main armhf libfreetype6 armhf 2.13.3+dfsg-1 [330 kB] 218s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf fonts-dejavu-mono all 2.37-8 [502 kB] 219s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf fonts-dejavu-core all 2.37-8 [835 kB] 219s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf fontconfig-config armhf 2.15.0-2ubuntu1 [37.5 kB] 219s Get:5 http://ftpmaster.internal/ubuntu plucky/main armhf libfontconfig1 armhf 2.15.0-2ubuntu1 [114 kB] 220s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf fontconfig armhf 2.15.0-2ubuntu1 [190 kB] 220s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf libblas3 armhf 3.12.1-2 [132 kB] 220s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf libpixman-1-0 armhf 0.44.0-3 [183 kB] 220s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf libxcb-render0 armhf 1.17.0-2 [15.3 kB] 220s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf libxcb-shm0 armhf 1.17.0-2 [5774 B] 220s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf libxrender1 armhf 1:0.9.10-1.1build1 [16.0 kB] 220s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf libcairo2 armhf 1.18.2-2 [484 kB] 221s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libdatrie1 armhf 0.2.13-3build1 [15.7 kB] 221s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf libdeflate0 armhf 1.23-1 [38.5 kB] 221s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf libgfortran5 armhf 15-20250222-0ubuntu1 [330 kB] 221s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf libgit2-1.9 armhf 1.9.0+ds-1ubuntu1 [485 kB] 222s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf libgomp1 armhf 15-20250222-0ubuntu1 [128 kB] 222s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf libgraphite2-3 armhf 1.3.14-2ubuntu1 [64.8 kB] 222s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf libharfbuzz0b armhf 10.2.0-1 [464 kB] 222s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf x11-common all 1:7.7+23ubuntu3 [21.7 kB] 222s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf libice6 armhf 2:1.1.1-1 [36.5 kB] 222s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf libjpeg-turbo8 armhf 2.1.5-3ubuntu2 [127 kB] 223s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf libjpeg8 armhf 8c-2ubuntu11 [2148 B] 223s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf liblapack3 armhf 3.12.1-2 [2091 kB] 225s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf liblerc4 armhf 4.0.0+ds-5ubuntu1 [160 kB] 225s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf libthai-data all 0.1.29-2build1 [158 kB] 225s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf libthai0 armhf 0.1.29-2build1 [15.2 kB] 226s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf libpango-1.0-0 armhf 1.56.2-1 [216 kB] 226s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf libpangoft2-1.0-0 armhf 1.56.2-1 [43.6 kB] 226s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf libpangocairo-1.0-0 armhf 1.56.2-1 [25.1 kB] 226s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf libpaper2 armhf 2.2.5-0.3 [16.3 kB] 226s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf libpaper-utils armhf 2.2.5-0.3 [14.2 kB] 226s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf libsharpyuv0 armhf 1.5.0-0.1 [16.4 kB] 226s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf libsm6 armhf 2:1.2.4-1 [15.1 kB] 226s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf libtcl8.6 armhf 8.6.16+dfsg-1 [909 kB] 227s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf libjbig0 armhf 2.1-6.1ubuntu2 [24.9 kB] 227s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf libwebp7 armhf 1.5.0-0.1 [188 kB] 227s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf libtiff6 armhf 4.5.1+git230720-4ubuntu4 [179 kB] 227s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf libxft2 armhf 2.3.6-1build1 [37.4 kB] 227s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf libxss1 armhf 1:1.2.3-1build3 [6500 B] 227s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf libtk8.6 armhf 8.6.16-1 [686 kB] 228s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf libxt6t64 armhf 1:1.2.1-1.2build1 [145 kB] 228s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf zip armhf 3.0-14ubuntu2 [164 kB] 228s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf unzip armhf 6.0-28ubuntu6 [167 kB] 228s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf xdg-utils all 1.2.1-2ubuntu1 [66.0 kB] 228s Get:46 http://ftpmaster.internal/ubuntu plucky/universe armhf r-base-core armhf 4.4.3-1 [28.2 MB] 258s Get:47 http://ftpmaster.internal/ubuntu plucky/universe armhf r-cran-git2r armhf 0.35.0-1build1 [438 kB] 259s Preconfiguring packages ... 259s Fetched 38.5 MB in 41s (930 kB/s) 259s Selecting previously unselected package libfreetype6:armhf. 259s (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 ... 64655 files and directories currently installed.) 259s Preparing to unpack .../00-libfreetype6_2.13.3+dfsg-1_armhf.deb ... 259s Unpacking libfreetype6:armhf (2.13.3+dfsg-1) ... 259s Selecting previously unselected package fonts-dejavu-mono. 259s Preparing to unpack .../01-fonts-dejavu-mono_2.37-8_all.deb ... 259s Unpacking fonts-dejavu-mono (2.37-8) ... 259s Selecting previously unselected package fonts-dejavu-core. 259s Preparing to unpack .../02-fonts-dejavu-core_2.37-8_all.deb ... 260s Unpacking fonts-dejavu-core (2.37-8) ... 260s Selecting previously unselected package fontconfig-config. 260s Preparing to unpack .../03-fontconfig-config_2.15.0-2ubuntu1_armhf.deb ... 260s Unpacking fontconfig-config (2.15.0-2ubuntu1) ... 260s Selecting previously unselected package libfontconfig1:armhf. 260s Preparing to unpack .../04-libfontconfig1_2.15.0-2ubuntu1_armhf.deb ... 260s Unpacking libfontconfig1:armhf (2.15.0-2ubuntu1) ... 260s Selecting previously unselected package fontconfig. 260s Preparing to unpack .../05-fontconfig_2.15.0-2ubuntu1_armhf.deb ... 260s Unpacking fontconfig (2.15.0-2ubuntu1) ... 260s Selecting previously unselected package libblas3:armhf. 260s Preparing to unpack .../06-libblas3_3.12.1-2_armhf.deb ... 260s Unpacking libblas3:armhf (3.12.1-2) ... 260s Selecting previously unselected package libpixman-1-0:armhf. 260s Preparing to unpack .../07-libpixman-1-0_0.44.0-3_armhf.deb ... 260s Unpacking libpixman-1-0:armhf (0.44.0-3) ... 260s Selecting previously unselected package libxcb-render0:armhf. 260s Preparing to unpack .../08-libxcb-render0_1.17.0-2_armhf.deb ... 260s Unpacking libxcb-render0:armhf (1.17.0-2) ... 260s Selecting previously unselected package libxcb-shm0:armhf. 260s Preparing to unpack .../09-libxcb-shm0_1.17.0-2_armhf.deb ... 260s Unpacking libxcb-shm0:armhf (1.17.0-2) ... 260s Selecting previously unselected package libxrender1:armhf. 260s Preparing to unpack .../10-libxrender1_1%3a0.9.10-1.1build1_armhf.deb ... 260s Unpacking libxrender1:armhf (1:0.9.10-1.1build1) ... 260s Selecting previously unselected package libcairo2:armhf. 260s Preparing to unpack .../11-libcairo2_1.18.2-2_armhf.deb ... 260s Unpacking libcairo2:armhf (1.18.2-2) ... 260s Selecting previously unselected package libdatrie1:armhf. 260s Preparing to unpack .../12-libdatrie1_0.2.13-3build1_armhf.deb ... 260s Unpacking libdatrie1:armhf (0.2.13-3build1) ... 260s Selecting previously unselected package libdeflate0:armhf. 260s Preparing to unpack .../13-libdeflate0_1.23-1_armhf.deb ... 260s Unpacking libdeflate0:armhf (1.23-1) ... 260s Selecting previously unselected package libgfortran5:armhf. 260s Preparing to unpack .../14-libgfortran5_15-20250222-0ubuntu1_armhf.deb ... 260s Unpacking libgfortran5:armhf (15-20250222-0ubuntu1) ... 260s Selecting previously unselected package libgit2-1.9:armhf. 260s Preparing to unpack .../15-libgit2-1.9_1.9.0+ds-1ubuntu1_armhf.deb ... 260s Unpacking libgit2-1.9:armhf (1.9.0+ds-1ubuntu1) ... 260s Selecting previously unselected package libgomp1:armhf. 260s Preparing to unpack .../16-libgomp1_15-20250222-0ubuntu1_armhf.deb ... 260s Unpacking libgomp1:armhf (15-20250222-0ubuntu1) ... 260s Selecting previously unselected package libgraphite2-3:armhf. 260s Preparing to unpack .../17-libgraphite2-3_1.3.14-2ubuntu1_armhf.deb ... 260s Unpacking libgraphite2-3:armhf (1.3.14-2ubuntu1) ... 260s Selecting previously unselected package libharfbuzz0b:armhf. 260s Preparing to unpack .../18-libharfbuzz0b_10.2.0-1_armhf.deb ... 260s Unpacking libharfbuzz0b:armhf (10.2.0-1) ... 260s Selecting previously unselected package x11-common. 260s Preparing to unpack .../19-x11-common_1%3a7.7+23ubuntu3_all.deb ... 260s Unpacking x11-common (1:7.7+23ubuntu3) ... 260s Selecting previously unselected package libice6:armhf. 260s Preparing to unpack .../20-libice6_2%3a1.1.1-1_armhf.deb ... 260s Unpacking libice6:armhf (2:1.1.1-1) ... 261s Selecting previously unselected package libjpeg-turbo8:armhf. 261s Preparing to unpack .../21-libjpeg-turbo8_2.1.5-3ubuntu2_armhf.deb ... 261s Unpacking libjpeg-turbo8:armhf (2.1.5-3ubuntu2) ... 261s Selecting previously unselected package libjpeg8:armhf. 261s Preparing to unpack .../22-libjpeg8_8c-2ubuntu11_armhf.deb ... 261s Unpacking libjpeg8:armhf (8c-2ubuntu11) ... 261s Selecting previously unselected package liblapack3:armhf. 261s Preparing to unpack .../23-liblapack3_3.12.1-2_armhf.deb ... 261s Unpacking liblapack3:armhf (3.12.1-2) ... 261s Selecting previously unselected package liblerc4:armhf. 261s Preparing to unpack .../24-liblerc4_4.0.0+ds-5ubuntu1_armhf.deb ... 261s Unpacking liblerc4:armhf (4.0.0+ds-5ubuntu1) ... 261s Selecting previously unselected package libthai-data. 261s Preparing to unpack .../25-libthai-data_0.1.29-2build1_all.deb ... 261s Unpacking libthai-data (0.1.29-2build1) ... 261s Selecting previously unselected package libthai0:armhf. 261s Preparing to unpack .../26-libthai0_0.1.29-2build1_armhf.deb ... 261s Unpacking libthai0:armhf (0.1.29-2build1) ... 261s Selecting previously unselected package libpango-1.0-0:armhf. 261s Preparing to unpack .../27-libpango-1.0-0_1.56.2-1_armhf.deb ... 261s Unpacking libpango-1.0-0:armhf (1.56.2-1) ... 261s Selecting previously unselected package libpangoft2-1.0-0:armhf. 261s Preparing to unpack .../28-libpangoft2-1.0-0_1.56.2-1_armhf.deb ... 261s Unpacking libpangoft2-1.0-0:armhf (1.56.2-1) ... 261s Selecting previously unselected package libpangocairo-1.0-0:armhf. 261s Preparing to unpack .../29-libpangocairo-1.0-0_1.56.2-1_armhf.deb ... 261s Unpacking libpangocairo-1.0-0:armhf (1.56.2-1) ... 261s Selecting previously unselected package libpaper2:armhf. 261s Preparing to unpack .../30-libpaper2_2.2.5-0.3_armhf.deb ... 261s Unpacking libpaper2:armhf (2.2.5-0.3) ... 261s Selecting previously unselected package libpaper-utils. 261s Preparing to unpack .../31-libpaper-utils_2.2.5-0.3_armhf.deb ... 261s Unpacking libpaper-utils (2.2.5-0.3) ... 261s Selecting previously unselected package libsharpyuv0:armhf. 261s Preparing to unpack .../32-libsharpyuv0_1.5.0-0.1_armhf.deb ... 261s Unpacking libsharpyuv0:armhf (1.5.0-0.1) ... 261s Selecting previously unselected package libsm6:armhf. 261s Preparing to unpack .../33-libsm6_2%3a1.2.4-1_armhf.deb ... 261s Unpacking libsm6:armhf (2:1.2.4-1) ... 261s Selecting previously unselected package libtcl8.6:armhf. 261s Preparing to unpack .../34-libtcl8.6_8.6.16+dfsg-1_armhf.deb ... 261s Unpacking libtcl8.6:armhf (8.6.16+dfsg-1) ... 261s Selecting previously unselected package libjbig0:armhf. 261s Preparing to unpack .../35-libjbig0_2.1-6.1ubuntu2_armhf.deb ... 261s Unpacking libjbig0:armhf (2.1-6.1ubuntu2) ... 261s Selecting previously unselected package libwebp7:armhf. 261s Preparing to unpack .../36-libwebp7_1.5.0-0.1_armhf.deb ... 261s Unpacking libwebp7:armhf (1.5.0-0.1) ... 261s Selecting previously unselected package libtiff6:armhf. 261s Preparing to unpack .../37-libtiff6_4.5.1+git230720-4ubuntu4_armhf.deb ... 261s Unpacking libtiff6:armhf (4.5.1+git230720-4ubuntu4) ... 261s Selecting previously unselected package libxft2:armhf. 261s Preparing to unpack .../38-libxft2_2.3.6-1build1_armhf.deb ... 261s Unpacking libxft2:armhf (2.3.6-1build1) ... 261s Selecting previously unselected package libxss1:armhf. 261s Preparing to unpack .../39-libxss1_1%3a1.2.3-1build3_armhf.deb ... 261s Unpacking libxss1:armhf (1:1.2.3-1build3) ... 261s Selecting previously unselected package libtk8.6:armhf. 261s Preparing to unpack .../40-libtk8.6_8.6.16-1_armhf.deb ... 261s Unpacking libtk8.6:armhf (8.6.16-1) ... 261s Selecting previously unselected package libxt6t64:armhf. 261s Preparing to unpack .../41-libxt6t64_1%3a1.2.1-1.2build1_armhf.deb ... 261s Unpacking libxt6t64:armhf (1:1.2.1-1.2build1) ... 261s Selecting previously unselected package zip. 261s Preparing to unpack .../42-zip_3.0-14ubuntu2_armhf.deb ... 261s Unpacking zip (3.0-14ubuntu2) ... 261s Selecting previously unselected package unzip. 261s Preparing to unpack .../43-unzip_6.0-28ubuntu6_armhf.deb ... 261s Unpacking unzip (6.0-28ubuntu6) ... 262s Selecting previously unselected package xdg-utils. 262s Preparing to unpack .../44-xdg-utils_1.2.1-2ubuntu1_all.deb ... 262s Unpacking xdg-utils (1.2.1-2ubuntu1) ... 262s Selecting previously unselected package r-base-core. 262s Preparing to unpack .../45-r-base-core_4.4.3-1_armhf.deb ... 262s Unpacking r-base-core (4.4.3-1) ... 262s Selecting previously unselected package r-cran-git2r. 262s Preparing to unpack .../46-r-cran-git2r_0.35.0-1build1_armhf.deb ... 262s Unpacking r-cran-git2r (0.35.0-1build1) ... 262s Setting up libgraphite2-3:armhf (1.3.14-2ubuntu1) ... 262s Setting up libpixman-1-0:armhf (0.44.0-3) ... 262s Setting up libsharpyuv0:armhf (1.5.0-0.1) ... 262s Setting up liblerc4:armhf (4.0.0+ds-5ubuntu1) ... 262s Setting up libxrender1:armhf (1:0.9.10-1.1build1) ... 262s Setting up libdatrie1:armhf (0.2.13-3build1) ... 262s Setting up libxcb-render0:armhf (1.17.0-2) ... 262s Setting up unzip (6.0-28ubuntu6) ... 262s Setting up x11-common (1:7.7+23ubuntu3) ... 262s Setting up libdeflate0:armhf (1.23-1) ... 262s Setting up libxcb-shm0:armhf (1.17.0-2) ... 262s Setting up libgomp1:armhf (15-20250222-0ubuntu1) ... 262s Setting up libjbig0:armhf (2.1-6.1ubuntu2) ... 262s Setting up zip (3.0-14ubuntu2) ... 262s Setting up libblas3:armhf (3.12.1-2) ... 262s update-alternatives: using /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3 to provide /usr/lib/arm-linux-gnueabihf/libblas.so.3 (libblas.so.3-arm-linux-gnueabihf) in auto mode 262s Setting up libfreetype6:armhf (2.13.3+dfsg-1) ... 262s Setting up fonts-dejavu-mono (2.37-8) ... 262s Setting up libtcl8.6:armhf (8.6.16+dfsg-1) ... 262s Setting up fonts-dejavu-core (2.37-8) ... 262s Setting up libjpeg-turbo8:armhf (2.1.5-3ubuntu2) ... 262s Setting up libgit2-1.9:armhf (1.9.0+ds-1ubuntu1) ... 262s Setting up libgfortran5:armhf (15-20250222-0ubuntu1) ... 262s Setting up libwebp7:armhf (1.5.0-0.1) ... 262s Setting up libharfbuzz0b:armhf (10.2.0-1) ... 262s Setting up libthai-data (0.1.29-2build1) ... 262s Setting up libxss1:armhf (1:1.2.3-1build3) ... 262s Setting up libpaper2:armhf (2.2.5-0.3) ... 263s Setting up xdg-utils (1.2.1-2ubuntu1) ... 263s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 263s Setting up libjpeg8:armhf (8c-2ubuntu11) ... 263s Setting up libice6:armhf (2:1.1.1-1) ... 263s Setting up liblapack3:armhf (3.12.1-2) ... 263s update-alternatives: using /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3 to provide /usr/lib/arm-linux-gnueabihf/liblapack.so.3 (liblapack.so.3-arm-linux-gnueabihf) in auto mode 263s Setting up fontconfig-config (2.15.0-2ubuntu1) ... 263s Setting up libpaper-utils (2.2.5-0.3) ... 263s Setting up libthai0:armhf (0.1.29-2build1) ... 263s Setting up libtiff6:armhf (4.5.1+git230720-4ubuntu4) ... 263s Setting up libfontconfig1:armhf (2.15.0-2ubuntu1) ... 263s Setting up libsm6:armhf (2:1.2.4-1) ... 263s Setting up fontconfig (2.15.0-2ubuntu1) ... 265s Regenerating fonts cache... done. 265s Setting up libxft2:armhf (2.3.6-1build1) ... 265s Setting up libtk8.6:armhf (8.6.16-1) ... 265s Setting up libpango-1.0-0:armhf (1.56.2-1) ... 265s Setting up libcairo2:armhf (1.18.2-2) ... 265s Setting up libxt6t64:armhf (1:1.2.1-1.2build1) ... 265s Setting up libpangoft2-1.0-0:armhf (1.56.2-1) ... 265s Setting up libpangocairo-1.0-0:armhf (1.56.2-1) ... 265s Setting up r-base-core (4.4.3-1) ... 265s Creating config file /etc/R/Renviron with new version 265s Setting up r-cran-git2r (0.35.0-1build1) ... 265s Processing triggers for man-db (2.13.0-1) ... 266s Processing triggers for install-info (7.1.1-1) ... 266s Processing triggers for libc-bin (2.41-1ubuntu2) ... 274s autopkgtest [16:15:03]: test run-unit-test: [----------------------- 276s BEGIN TEST add-force.R 276s 276s R version 4.4.3 (2025-02-28) -- "Trophy Case" 276s Copyright (C) 2025 The R Foundation for Statistical Computing 276s Platform: arm-unknown-linux-gnueabihf (32-bit) 276s 276s R is free software and comes with ABSOLUTELY NO WARRANTY. 276s You are welcome to redistribute it under certain conditions. 276s Type 'license()' or 'licence()' for distribution details. 276s 276s R is a collaborative project with many contributors. 276s Type 'contributors()' for more information and 276s 'citation()' on how to cite R or R packages in publications. 276s 276s Type 'demo()' for some demos, 'help()' for on-line help, or 276s 'help.start()' for an HTML browser interface to help. 276s Type 'q()' to quit R. 276s 276s > ## git2r, R bindings to the libgit2 library. 276s > ## Copyright (C) 2013-2023 The git2r contributors 276s > ## 276s > ## This program is free software; you can redistribute it and/or modify 276s > ## it under the terms of the GNU General Public License, version 2, 276s > ## as published by the Free Software Foundation. 276s > ## 276s > ## git2r is distributed in the hope that it will be useful, 276s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 276s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 276s > ## GNU General Public License for more details. 276s > ## 276s > ## You should have received a copy of the GNU General Public License along 276s > ## with this program; if not, write to the Free Software Foundation, Inc., 276s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 276s > 276s > library(git2r) 276s > source("util/check.R") 276s > 276s > ## For debugging 276s > sessionInfo() 276s R version 4.4.3 (2025-02-28) 276s Platform: arm-unknown-linux-gnueabihf (32-bit) 276s Running under: Ubuntu Plucky Puffin (development branch) 276s 276s Matrix products: default 276s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 276s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 276s 276s locale: 276s [1] C 276s 276s time zone: Etc/UTC 276s tzcode source: system (glibc) 276s 276s attached base packages: 276s [1] stats graphics grDevices utils datasets methods base 276s 276s other attached packages: 276s [1] git2r_0.35.0 276s 276s loaded via a namespace (and not attached): 276s [1] compiler_4.4.3 276s > libgit2_version() 276s $major 276s [1] 1 276s 276s $minor 276s [1] 9 276s 276s $rev 276s [1] 0 276s 276s > libgit2_features() 276s $threads 276s [1] TRUE 276s 276s $https 276s [1] TRUE 276s 276s $ssh 276s [1] TRUE 276s 276s > 276s > ## Create a directory in tempdir 276s > path <- tempfile(pattern = "git2r-") 276s > dir.create(path) 276s > 276s > ## Initialize a repository 276s > repo <- init(path) 276s > config(repo, user.name = "Alice", user.email = "alice@example.org") 276s > 276s > ## Create a '.gitignore' file 276s > writeLines("test.txt", file.path(path, ".gitignore")) 276s > add(repo, ".gitignore") 276s > commit(repo, "First commit message") 276s [5556793] 2025-03-15: First commit message 276s > 276s > ## Create a file 276s > writeLines("Hello world!", file.path(path, "test.txt")) 276s > 276s > ## Check status 276s > s_1 <- structure(list(staged = empty_named_list(), 276s + unstaged = empty_named_list(), 276s + untracked = empty_named_list(), 276s + ignored = list(ignored = "test.txt")), 276s + class = "git_status") 276s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 276s > 276s > ## The file is ignored and should not be added 276s > add(repo, "test.txt") 276s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 276s > 276s > ## The file is ignored but should be added with force 276s > s_2 <- structure(list(staged = list(new = "test.txt"), 276s + unstaged = empty_named_list(), 276s + untracked = empty_named_list(), 276s + ignored = empty_named_list()), 276s + class = "git_status") 276s > 276s > add(repo, "test.txt", force = TRUE) 276s > stopifnot(identical(status(repo, ignored = TRUE), s_2)) 276s > 276s > ## Commit and check status 276s > s_3 <- structure(list(staged = empty_named_list(), 276s + unstaged = empty_named_list(), 276s + untracked = empty_named_list(), 276s + ignored = empty_named_list()), 276s + class = "git_status") 276s > 276s > commit(repo, "Second commit message") 276s [fd572a5] 2025-03-15: Second commit message 276s > stopifnot(identical(status(repo, ignored = TRUE), s_3)) 276s > 276s > ## Cleanup 276s > unlink(path, recursive = TRUE) 276s > 276s BEGIN TEST bare_repository.R 276s 276s R version 4.4.3 (2025-02-28) -- "Trophy Case" 276s Copyright (C) 2025 The R Foundation for Statistical Computing 276s Platform: arm-unknown-linux-gnueabihf (32-bit) 276s 276s R is free software and comes with ABSOLUTELY NO WARRANTY. 276s You are welcome to redistribute it under certain conditions. 276s Type 'license()' or 'licence()' for distribution details. 276s 276s R is a collaborative project with many contributors. 276s Type 'contributors()' for more information and 276s 'citation()' on how to cite R or R packages in publications. 276s 276s Type 'demo()' for some demos, 'help()' for on-line help, or 276s 'help.start()' for an HTML browser interface to help. 276s Type 'q()' to quit R. 276s 276s > ## git2r, R bindings to the libgit2 library. 276s > ## Copyright (C) 2013-2023 The git2r contributors 276s > ## 276s > ## This program is free software; you can redistribute it and/or modify 276s > ## it under the terms of the GNU General Public License, version 2, 276s > ## as published by the Free Software Foundation. 276s > ## 276s > ## git2r is distributed in the hope that it will be useful, 276s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 276s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 276s > ## GNU General Public License for more details. 276s > ## 276s > ## You should have received a copy of the GNU General Public License along 276s > ## with this program; if not, write to the Free Software Foundation, Inc., 276s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 276s > 276s > library("git2r") 276s > 276s > ## For debugging 276s > sessionInfo() 276s R version 4.4.3 (2025-02-28) 276s Platform: arm-unknown-linux-gnueabihf (32-bit) 276s Running under: Ubuntu Plucky Puffin (development branch) 276s 276s Matrix products: default 276s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 276s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 276s 276s locale: 276s [1] C 276s 276s time zone: Etc/UTC 276s tzcode source: system (glibc) 276s 276s attached base packages: 276s [1] stats graphics grDevices utils datasets methods base 276s 276s other attached packages: 276s [1] git2r_0.35.0 276s 276s loaded via a namespace (and not attached): 276s [1] compiler_4.4.3 276s > libgit2_version() 276s $major 276s [1] 1 276s 276s $minor 276s [1] 9 276s 276s $rev 276s [1] 0 276s 276s > libgit2_features() 276s $threads 276s [1] TRUE 276s 276s $https 276s [1] TRUE 276s 276s $ssh 276s [1] TRUE 276s 276s > 276s > 276s > ## Create a directory in tempdir 276s > path <- tempfile(pattern = "git2r-") 276s > dir.create(path) 276s > 276s > ## Initialize a bare repository 276s > repo <- init(path, bare = TRUE) 276s > 276s > ## Check that the state of the repository 276s > stopifnot(identical(is_bare(repo), TRUE)) 276s > stopifnot(identical(is_empty(repo), TRUE)) 276s > 276s > ## Check that workdir is NULL for a bare repository 276s > stopifnot(is.null(workdir(repo))) 276s > 276s > ## Check with missing repo argument 276s > setwd(path) 276s > stopifnot(identical(is_bare(), TRUE)) 276s > 276s > ## Cleanup 276s > unlink(path, recursive = TRUE) 276s > 276s sh: 0: getcwd() failed: No such file or directory 276s BEGIN TEST blame.R 276s 276s R version 4.4.3 (2025-02-28) -- "Trophy Case" 276s Copyright (C) 2025 The R Foundation for Statistical Computing 276s Platform: arm-unknown-linux-gnueabihf (32-bit) 276s 276s R is free software and comes with ABSOLUTELY NO WARRANTY. 276s You are welcome to redistribute it under certain conditions. 276s Type 'license()' or 'licence()' for distribution details. 276s 276s R is a collaborative project with many contributors. 276s Type 'contributors()' for more information and 276s 'citation()' on how to cite R or R packages in publications. 276s 276s Type 'demo()' for some demos, 'help()' for on-line help, or 276s 'help.start()' for an HTML browser interface to help. 276s Type 'q()' to quit R. 276s 276s > ## git2r, R bindings to the libgit2 library. 276s > ## Copyright (C) 2013-2023 The git2r contributors 276s > ## 276s > ## This program is free software; you can redistribute it and/or modify 276s > ## it under the terms of the GNU General Public License, version 2, 276s > ## as published by the Free Software Foundation. 276s > ## 276s > ## git2r is distributed in the hope that it will be useful, 276s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 276s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 276s > ## GNU General Public License for more details. 276s > ## 276s > ## You should have received a copy of the GNU General Public License along 276s > ## with this program; if not, write to the Free Software Foundation, Inc., 276s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 276s > 276s > library(git2r) 276s > 276s > ## For debugging 276s > sessionInfo() 277s R version 4.4.3 (2025-02-28) 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s Running under: Ubuntu Plucky Puffin (development branch) 277s 277s Matrix products: default 277s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 277s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 277s 277s locale: 277s [1] C 277s 277s time zone: Etc/UTC 277s tzcode source: system (glibc) 277s 277s attached base packages: 277s [1] stats graphics grDevices utils datasets methods base 277s 277s other attached packages: 277s [1] git2r_0.35.0 277s 277s loaded via a namespace (and not attached): 277s [1] compiler_4.4.3 277s > libgit2_version() 277s $major 277s [1] 1 277s 277s $minor 277s [1] 9 277s 277s $rev 277s [1] 0 277s 277s > libgit2_features() 277s $threads 277s [1] TRUE 277s 277s $https 277s [1] TRUE 277s 277s $ssh 277s [1] TRUE 277s 277s > 277s > 277s > ## Create a directory in tempdir 277s > path <- tempfile(pattern = "git2r-") 277s > dir.create(path) 277s > 277s > ## Initialize a repository 277s > repo <- init(path) 277s > config(repo, user.name = "Alice", user.email = "alice@example.org") 277s > 277s > ## Create a file and commit 277s > writeLines("Hello world!", file.path(path, "test.txt")) 277s > add(repo, "test.txt") 277s > commit_1 <- commit(repo, "First commit message") 277s > 277s > ## Create new user and change file 277s > config(repo, user.name = "Bob", user.email = "bob@example.org") 277s > writeLines(c("Hello world!", "HELLO WORLD!", "HOLA"), 277s + file.path(path, "test.txt")) 277s > add(repo, "test.txt") 277s > commit_2 <- commit(repo, "Second commit message") 277s > 277s > ## Check blame 277s > b <- blame(repo, "test.txt") 277s > stopifnot(identical(length(b$hunks), 2L)) 277s > 277s > ## Hunk: 1 277s > stopifnot(identical(b$hunks[[1]]$lines_in_hunk, 1L)) 277s > stopifnot(identical(b$hunks[[1]]$final_commit_id, sha(commit_1))) 277s > stopifnot(identical(b$hunks[[1]]$final_start_line_number, 1L)) 277s > stopifnot(identical(b$hunks[[1]]$final_signature$name, "Alice")) 277s > stopifnot(identical(b$hunks[[1]]$final_signature$email, "alice@example.org")) 277s > stopifnot(identical(b$hunks[[1]]$orig_commit_id, sha(commit_1))) 277s > stopifnot(identical(b$hunks[[1]]$orig_start_line_number, 1L)) 277s > stopifnot(identical(b$hunks[[1]]$orig_signature$name, "Alice")) 277s > stopifnot(identical(b$hunks[[1]]$orig_signature$email, "alice@example.org")) 277s > stopifnot(identical(b$hunks[[1]]$orig_path, "test.txt")) 277s > stopifnot(identical(b$hunks[[1]]$boundary, TRUE)) 277s > 277s > ## Hunk: 2 277s > stopifnot(identical(b$hunks[[2]]$lines_in_hunk, 2L)) 277s > stopifnot(identical(b$hunks[[2]]$final_commit_id, sha(commit_2))) 277s > stopifnot(identical(b$hunks[[2]]$final_start_line_number, 2L)) 277s > stopifnot(identical(b$hunks[[2]]$final_signature$name, "Bob")) 277s > stopifnot(identical(b$hunks[[2]]$final_signature$email, "bob@example.org")) 277s > stopifnot(identical(b$hunks[[2]]$orig_commit_id, sha(commit_2))) 277s > stopifnot(identical(b$hunks[[2]]$orig_start_line_number, 2L)) 277s > stopifnot(identical(b$hunks[[2]]$orig_signature$name, "Bob")) 277s > stopifnot(identical(b$hunks[[2]]$orig_signature$email, "bob@example.org")) 277s > stopifnot(identical(b$hunks[[2]]$orig_path, "test.txt")) 277s > stopifnot(identical(b$hunks[[2]]$boundary, FALSE)) 277s > 277s > ## Cleanup 277s > unlink(path, recursive = TRUE) 277s > 277s BEGIN TEST blob.R 277s 277s R version 4.4.3 (2025-02-28) -- "Trophy Case" 277s Copyright (C) 2025 The R Foundation for Statistical Computing 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s 277s R is free software and comes with ABSOLUTELY NO WARRANTY. 277s You are welcome to redistribute it under certain conditions. 277s Type 'license()' or 'licence()' for distribution details. 277s 277s R is a collaborative project with many contributors. 277s Type 'contributors()' for more information and 277s 'citation()' on how to cite R or R packages in publications. 277s 277s Type 'demo()' for some demos, 'help()' for on-line help, or 277s 'help.start()' for an HTML browser interface to help. 277s Type 'q()' to quit R. 277s 277s > ## git2r, R bindings to the libgit2 library. 277s > ## Copyright (C) 2013-2023 The git2r contributors 277s > ## 277s > ## This program is free software; you can redistribute it and/or modify 277s > ## it under the terms of the GNU General Public License, version 2, 277s > ## as published by the Free Software Foundation. 277s > ## 277s > ## git2r is distributed in the hope that it will be useful, 277s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 277s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 277s > ## GNU General Public License for more details. 277s > ## 277s > ## You should have received a copy of the GNU General Public License along 277s > ## with this program; if not, write to the Free Software Foundation, Inc., 277s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 277s > 277s > library(git2r) 277s > library(tools) 277s > source("util/check.R") 277s > 277s > ## For debugging 277s > sessionInfo() 277s R version 4.4.3 (2025-02-28) 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s Running under: Ubuntu Plucky Puffin (development branch) 277s 277s Matrix products: default 277s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 277s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 277s 277s locale: 277s [1] C 277s 277s time zone: Etc/UTC 277s tzcode source: system (glibc) 277s 277s attached base packages: 277s [1] tools stats graphics grDevices utils datasets methods 277s [8] base 277s 277s other attached packages: 277s [1] git2r_0.35.0 277s 277s loaded via a namespace (and not attached): 277s [1] compiler_4.4.3 277s > libgit2_version() 277s $major 277s [1] 1 277s 277s $minor 277s [1] 9 277s 277s $rev 277s [1] 0 277s 277s > libgit2_features() 277s $threads 277s [1] TRUE 277s 277s $https 277s [1] TRUE 277s 277s $ssh 277s [1] TRUE 277s 277s > 277s > 277s > ## Create a directory in tempdir 277s > path <- tempfile(pattern = "git2r-") 277s > dir.create(path) 277s > 277s > ## Initialize a repository 277s > repo <- init(path) 277s > config(repo, user.name = "Alice", user.email = "alice@example.org") 277s > 277s > ## Create a file 277s > f <- file(file.path(path, "test.txt"), "wb") 277s > writeChar("Hello world!\n", f, eos = NULL) 277s > close(f) 277s > 277s > ## add and commit 277s > add(repo, "test.txt") 277s > new_commit <- commit(repo, "Commit message") 277s > 277s > ## Lookup blob 277s > blob <- lookup(repo, "cd0875583aabe89ee197ea133980a9085d08e497") 277s > stopifnot(isTRUE(is_blob(blob))) 277s > stopifnot(identical(sha(blob), "cd0875583aabe89ee197ea133980a9085d08e497")) 277s > stopifnot(identical(is_binary(blob), FALSE)) 277s > stopifnot(identical(blob, lookup(repo, "cd0875"))) 277s > stopifnot(identical(length(blob), 13L)) 277s > stopifnot(identical(content(blob), "Hello world!")) 277s > stopifnot(identical(print(blob), blob)) 277s blob: cd0875583aabe89ee197ea133980a9085d08e497 277s size: 13 bytes 277s > 277s > ## Add one more commit 277s > f <- file(file.path(path, "test.txt"), "wb") 277s > writeChar("Hello world!\nHELLO WORLD!\nHeLlO wOrLd!\n", f, eos = NULL) 277s > close(f) 277s > add(repo, "test.txt") 277s > blob <- lookup(repo, tree(commit(repo, "New commit message"))$id[1]) 277s > stopifnot(identical(content(blob), 277s + c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"))) 277s > stopifnot(identical(rawToChar(content(blob, raw = TRUE)), 277s + content(blob, split = FALSE))) 277s > 277s > ## Check content of binary file 277s > set.seed(42) 277s > x <- as.raw((sample(0:255, 1000, replace = TRUE))) 277s > writeBin(x, con = file.path(path, "test.bin")) 277s > add(repo, "test.bin") 277s > commit(repo, "Add binary file") 277s [0fd916e] 2025-03-15: Add binary file 277s > blob <- tree(last_commit(repo))["test.bin"] 277s > stopifnot(identical(content(blob), NA_character_)) 277s > stopifnot(identical(x, content(blob, raw = TRUE))) 277s > 277s > ## Hash 277s > stopifnot(identical(hash("Hello, world!\n"), 277s + "af5626b4a114abcb82d63db7c8082c3c4756e51b")) 277s > stopifnot(identical(hash("test content\n"), 277s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4")) 277s > stopifnot(identical(hash(c("Hello, world!\n", 277s + "test content\n")), 277s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 277s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 277s > stopifnot(identical(hash(c("Hello, world!\n", 277s + NA_character_, 277s + "test content\n")), 277s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 277s + NA_character_, 277s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 277s > stopifnot(identical(hash(character(0)), character(0))) 277s > 277s > ## Hash file 277s > test_1_txt <- file(file.path(path, "test-1.txt"), "wb") 277s > writeChar("Hello, world!\n", test_1_txt, eos = NULL) 277s > close(test_1_txt) 277s > test_2_txt <- file(file.path(path, "test-2.txt"), "wb") 277s > writeChar("test content\n", test_2_txt, eos = NULL) 277s > close(test_2_txt) 277s > stopifnot(identical(hash("Hello, world!\n"), 277s + hashfile(file.path(path, "test-1.txt")))) 277s > stopifnot(identical(hash("test content\n"), 277s + hashfile(file.path(path, "test-2.txt")))) 277s > stopifnot(identical(hash(c("Hello, world!\n", 277s + "test content\n")), 277s + hashfile(c(file.path(path, "test-1.txt"), 277s + file.path(path, "test-2.txt"))))) 277s > assertError(hashfile(c(file.path(path, "test-1.txt"), 277s + NA_character_, 277s + file.path(path, "test-2.txt")))) 277s > stopifnot(identical(hashfile(character(0)), character(0))) 277s > 277s > ## Create blob from disk 277s > tmp_file_1 <- tempfile() 277s > tmp_file_2 <- tempfile() 277s > f1 <- file(tmp_file_1, "wb") 277s > writeChar("Hello, world!\n", f1, eos = NULL) 277s > close(f1) 277s > f2 <- file(tmp_file_2, "wb") 277s > writeChar("test content\n", f2, eos = NULL) 277s > close(f2) 277s > blob_list_1 <- blob_create(repo, c(tmp_file_1, tmp_file_2), relative = FALSE) 277s > unlink(tmp_file_1) 277s > unlink(tmp_file_2) 277s > stopifnot(identical(sapply(blob_list_1, "[[", "sha"), 277s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 277s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 277s > 277s > ## Create blob from workdir 277s > tmp_file_3 <- file.path(path, "test-workdir-1.txt") 277s > tmp_file_4 <- file.path(path, "test-workdir-2.txt") 277s > f3 <- file(tmp_file_3, "wb") 277s > writeChar("Hello, world!\n", f3, eos = NULL) 277s > close(f3) 277s > f4 <- file(tmp_file_4, "wb") 277s > writeChar("test content\n", f4, eos = NULL) 277s > close(f4) 277s > blob_list_2 <- blob_create(repo, c("test-workdir-1.txt", 277s + "test-workdir-2.txt")) 277s > stopifnot(identical(sapply(blob_list_2, "[[", "sha"), 277s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 277s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 277s > 277s > ## Test arguments 277s > check_error(assertError(.Call(git2r:::git2r_blob_content, NULL, FALSE)), 277s + "'blob' must be an S3 class git_blob") 277s > check_error(assertError(.Call(git2r:::git2r_blob_content, 3, FALSE)), 277s + "'blob' must be an S3 class git_blob") 277s > check_error(assertError(.Call(git2r:::git2r_blob_content, repo, FALSE)), 277s + "'blob' must be an S3 class git_blob") 277s > 277s > b <- blob_list_1[[1]] 277s > b$sha <- NA_character_ 277s > check_error(assertError(.Call(git2r:::git2r_blob_content, b, FALSE)), 277s + "'blob' must be an S3 class git_blob") 277s > 277s > check_error(assertError(hashfile(NA)), "invalid 'path' argument") 277s > 277s > ## Cleanup 277s > unlink(path, recursive = TRUE) 277s > 277s BEGIN TEST branch.R 277s 277s R version 4.4.3 (2025-02-28) -- "Trophy Case" 277s Copyright (C) 2025 The R Foundation for Statistical Computing 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s 277s R is free software and comes with ABSOLUTELY NO WARRANTY. 277s You are welcome to redistribute it under certain conditions. 277s Type 'license()' or 'licence()' for distribution details. 277s 277s R is a collaborative project with many contributors. 277s Type 'contributors()' for more information and 277s 'citation()' on how to cite R or R packages in publications. 277s 277s Type 'demo()' for some demos, 'help()' for on-line help, or 277s 'help.start()' for an HTML browser interface to help. 277s Type 'q()' to quit R. 277s 277s > ## git2r, R bindings to the libgit2 library. 277s > ## Copyright (C) 2013-2023 The git2r contributors 277s > ## 277s > ## This program is free software; you can redistribute it and/or modify 277s > ## it under the terms of the GNU General Public License, version 2, 277s > ## as published by the Free Software Foundation. 277s > ## 277s > ## git2r is distributed in the hope that it will be useful, 277s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 277s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 277s > ## GNU General Public License for more details. 277s > ## 277s > ## You should have received a copy of the GNU General Public License along 277s > ## with this program; if not, write to the Free Software Foundation, Inc., 277s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 277s > 277s > library(git2r) 277s > 277s > ## For debugging 277s > sessionInfo() 277s R version 4.4.3 (2025-02-28) 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s Running under: Ubuntu Plucky Puffin (development branch) 277s 277s Matrix products: default 277s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 277s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 277s 277s locale: 277s [1] C 277s 277s time zone: Etc/UTC 277s tzcode source: system (glibc) 277s 277s attached base packages: 277s [1] stats graphics grDevices utils datasets methods base 277s 277s other attached packages: 277s [1] git2r_0.35.0 277s 277s loaded via a namespace (and not attached): 277s [1] compiler_4.4.3 277s > libgit2_version() 277s $major 277s [1] 1 277s 277s $minor 277s [1] 9 277s 277s $rev 277s [1] 0 277s 277s > libgit2_features() 277s $threads 277s [1] TRUE 277s 277s $https 277s [1] TRUE 277s 277s $ssh 277s [1] TRUE 277s 277s > 277s > 277s > ## Create a directory in tempdir 277s > path <- tempfile(pattern = "git2r-") 277s > dir.create(path) 277s > 277s > ## Initialize a repository 277s > repo <- init(path, branch = "main") 277s > config(repo, user.name = "Alice", user.email = "alice@example.org") 277s > 277s > ## Create a file 277s > writeLines("Hello world!", file.path(path, "test.txt")) 277s > 277s > ## add and commit 277s > add(repo, "test.txt") 277s > commit_1 <- commit(repo, "Commit message") 277s > 277s > ## Check branch 277s > stopifnot(identical(length(branches(repo)), 1L)) 277s > stopifnot(identical(is_head(branches(repo)[[1]]), TRUE)) 277s > stopifnot(identical(is_local(branches(repo)[[1]]), TRUE)) 277s > stopifnot(identical(branches(repo)[[1]]$name, "main")) 277s > stopifnot(identical(branches(repo)[[1]], repository_head(repo))) 277s > stopifnot(identical(branches(repo)$main, repository_head(repo))) 277s > 277s > ## Check branch argument 277s > res <- tools::assertError(is_local(1)) 277s > stopifnot(length(grep("argument 'branch' must be a 'git_branch' object", 277s + res[[1]]$message)) > 0) 277s > 277s > ## Check branch name argument 277s > res <- tools::assertError(branch_set_upstream()) 277s > stopifnot(length(grep("Missing argument name", 277s + res[[1]]$message)) > 0) 277s > 277s > ## Print branch 277s > b <- repository_head(repo) 277s > stopifnot(identical(print(b), b)) 277s [f18a20] (Local) (HEAD) main 277s > 277s > ## Create a branch 277s > b <- branch_create(commit_1, name = "test") 277s > stopifnot(identical(b$name, "test")) 277s > stopifnot(identical(b$type, 1L)) 277s > stopifnot(identical(sha(b), branch_target(b))) 277s > stopifnot(identical(length(branches(repo)), 2L)) 277s > stopifnot(identical(branch_target(branches(repo)[[1]]), 277s + branch_target(branches(repo)[[2]]))) 277s > 277s > ## Check is_branch 277s > stopifnot(identical(is_branch(b), TRUE)) 277s > stopifnot(identical(is_branch(5), FALSE)) 277s > 277s > ## Add one more commit 277s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 277s > add(repo, "test.txt") 277s > commit_2 <- commit(repo, "Another commit message") 277s > 277s > ## Now the first branch should have moved on 277s > stopifnot(!identical(branch_target(branches(repo)[[1]]), 277s + branch_target(branches(repo)[[2]]))) 277s > 277s > ## Create a branch with the same name should fail 277s > tools::assertError(branch_create(commit_2, name = "test")) 277s > 277s > ## Force it and check the branches are identical again 277s > b <- branch_create(commit_2, name = "test", force = TRUE) 277s > stopifnot(identical(branch_target(branches(repo)[[1]]), 277s + branch_target(branches(repo)[[2]]))) 277s > 277s > ## Test arguments 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, NULL)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, 3)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, repo)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > b_tmp <- b 277s > b_tmp$name <- NA_character_ 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > b_tmp <- b 277s > b_tmp$type <- NA_integer_ 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > b_tmp$type <- 3L 277s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 277s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 277s + res[[1]]$message)) > 0) 277s > 277s > ## Delete branch 277s > branch_delete(b) 277s > stopifnot(identical(length(branches(repo)), 1L)) 277s > 277s > ## Add one more commit 277s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world"), 277s + file.path(path, "test.txt")) 277s > add(repo, "test.txt") 277s > commit_3 <- commit(repo, "Another third commit message") 277s > 277s > ## Create and test renaming of branches 277s > b_1 <- branch_create(commit_1, name = "test-1") 277s > b_2 <- branch_create(commit_2, name = "test-2") 277s > b_3 <- branch_create(commit_3, name = "test-3") 277s > stopifnot(identical(length(branches(repo)), 4L)) 277s > b_1 <- branch_rename(b_1, name = "test-1-new-name") 277s > stopifnot(identical(length(branches(repo)), 4L)) 277s > stopifnot(identical(b_1$name, "test-1-new-name")) 277s > tools::assertError(branch_rename(b_1, name = "test-2")) 277s > branch_rename(b_1, name = "test-2", force = TRUE) 277s > stopifnot(identical(length(branches(repo)), 3L)) 277s > 277s > ## Check branches method with missing repo argument 277s > wd <- setwd(path) 277s > stopifnot(identical(length(branches()), 3L)) 277s > if (!is.null(wd)) 277s + setwd(wd) 277s > 277s > ## Cleanup 277s > unlink(path, recursive = TRUE) 277s > 277s BEGIN TEST bundle.R 277s 277s R version 4.4.3 (2025-02-28) -- "Trophy Case" 277s Copyright (C) 2025 The R Foundation for Statistical Computing 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s 277s R is free software and comes with ABSOLUTELY NO WARRANTY. 277s You are welcome to redistribute it under certain conditions. 277s Type 'license()' or 'licence()' for distribution details. 277s 277s R is a collaborative project with many contributors. 277s Type 'contributors()' for more information and 277s 'citation()' on how to cite R or R packages in publications. 277s 277s Type 'demo()' for some demos, 'help()' for on-line help, or 277s 'help.start()' for an HTML browser interface to help. 277s Type 'q()' to quit R. 277s 277s > ## git2r, R bindings to the libgit2 library. 277s > ## Copyright (C) 2013-2023 The git2r contributors 277s > ## 277s > ## This program is free software; you can redistribute it and/or modify 277s > ## it under the terms of the GNU General Public License, version 2, 277s > ## as published by the Free Software Foundation. 277s > ## 277s > ## git2r is distributed in the hope that it will be useful, 277s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 277s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 277s > ## GNU General Public License for more details. 277s > ## 277s > ## You should have received a copy of the GNU General Public License along 277s > ## with this program; if not, write to the Free Software Foundation, Inc., 277s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 277s > 277s > library("git2r") 277s > 277s > ## For debugging 277s > sessionInfo() 277s R version 4.4.3 (2025-02-28) 277s Platform: arm-unknown-linux-gnueabihf (32-bit) 277s Running under: Ubuntu Plucky Puffin (development branch) 277s 277s Matrix products: default 277s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 277s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 277s 277s locale: 277s [1] C 277s 277s time zone: Etc/UTC 277s tzcode source: system (glibc) 277s 277s attached base packages: 277s [1] stats graphics grDevices utils datasets methods base 277s 277s other attached packages: 277s [1] git2r_0.35.0 277s 277s loaded via a namespace (and not attached): 277s [1] compiler_4.4.3 277s > libgit2_version() 277s $major 277s [1] 1 277s 277s $minor 277s [1] 9 277s 277s $rev 277s [1] 0 277s 277s > libgit2_features() 277s $threads 277s [1] TRUE 277s 277s $https 277s [1] TRUE 277s 277s $ssh 277s [1] TRUE 277s 277s > 277s > 277s > ## Create a directory in tempdir 277s > path <- tempfile(pattern = "git2r-") 277s > dir.create(file.path(path, "bundle", "R"), recursive = TRUE) 277s > 277s > ## Initialize a repository 277s > repo <- init(file.path(path, "bundle")) 277s > config(repo, user.name = "Alice", user.email = "alice@example.org") 277s > 277s > ## Create a DESCRIPTION file 277s > writeLines(c( 277s + "package: bundle", 277s + "Title: Bundle Git Repository", 277s + "Description: Bundle a bare repository of the code in the 'inst' folder.", 277s + "Version: 0.1", 277s + "License: GPL-2", 277s + "Authors@R: person('Alice', role = c('aut', 'cre'),", 277s + " email = 'alice@example.org')"), 277s + con = file.path(path, "bundle", "DESCRIPTION")) 277s > add(repo, file.path(path, "bundle", "DESCRIPTION")) 277s > commit(repo, "Add DESCRIPTION file") 277s [5b1c68e] 2025-03-15: Add DESCRIPTION file 277s > 277s > ## Create R file 277s > writeLines("f <- function(x, y) x+y", 277s + con = file.path(path, "bundle", "R", "bundle.R")) 277s > add(repo, file.path(path, "bundle", "R", "bundle.R")) 277s > commit(repo, "Add R file") 277s [b7b3e08] 2025-03-15: Add R file 277s > 277s > ## Bundle package 277s > bundle_r_package(repo) 277s cloning into '/tmp/RtmpDJq89B/git2r-727ce831d3/bundle/inst/bundle.git'... 277s > 277s > ## Fails if bundled package exists 277s > tools::assertError(bundle_r_package(repo)) 277s > 277s > ## Cleanup 277s > unlink(path, recursive = TRUE) 277s > 277s BEGIN TEST checkout-named-branch.R 278s 278s R version 4.4.3 (2025-02-28) -- "Trophy Case" 278s Copyright (C) 2025 The R Foundation for Statistical Computing 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s 278s R is free software and comes with ABSOLUTELY NO WARRANTY. 278s You are welcome to redistribute it under certain conditions. 278s Type 'license()' or 'licence()' for distribution details. 278s 278s R is a collaborative project with many contributors. 278s Type 'contributors()' for more information and 278s 'citation()' on how to cite R or R packages in publications. 278s 278s Type 'demo()' for some demos, 'help()' for on-line help, or 278s 'help.start()' for an HTML browser interface to help. 278s Type 'q()' to quit R. 278s 278s > ## git2r, R bindings to the libgit2 library. 278s > ## Copyright (C) 2013-2023 The git2r contributors 278s > ## 278s > ## This program is free software; you can redistribute it and/or modify 278s > ## it under the terms of the GNU General Public License, version 2, 278s > ## as published by the Free Software Foundation. 278s > ## 278s > ## git2r is distributed in the hope that it will be useful, 278s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 278s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 278s > ## GNU General Public License for more details. 278s > ## 278s > ## You should have received a copy of the GNU General Public License along 278s > ## with this program; if not, write to the Free Software Foundation, Inc., 278s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 278s > 278s > library(git2r) 278s > 278s > ## For debugging 278s > sessionInfo() 278s R version 4.4.3 (2025-02-28) 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s Running under: Ubuntu Plucky Puffin (development branch) 278s 278s Matrix products: default 278s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 278s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 278s 278s locale: 278s [1] C 278s 278s time zone: Etc/UTC 278s tzcode source: system (glibc) 278s 278s attached base packages: 278s [1] stats graphics grDevices utils datasets methods base 278s 278s other attached packages: 278s [1] git2r_0.35.0 278s 278s loaded via a namespace (and not attached): 278s [1] compiler_4.4.3 278s > libgit2_version() 278s $major 278s [1] 1 278s 278s $minor 278s [1] 9 278s 278s $rev 278s [1] 0 278s 278s > libgit2_features() 278s $threads 278s [1] TRUE 278s 278s $https 278s [1] TRUE 278s 278s $ssh 278s [1] TRUE 278s 278s > 278s > 278s > ## Create directories for repositories in tempdir 278s > path_bare <- tempfile(pattern = "git2r-") 278s > path_repo_1 <- tempfile(pattern = "git2r-") 278s > path_repo_2 <- tempfile(pattern = "git2r-") 278s > 278s > dir.create(path_bare) 278s > dir.create(path_repo_1) 278s > dir.create(path_repo_2) 278s > 278s > ## Create bare repository 278s > bare_repo <- init(path_bare, bare = TRUE) 278s > 278s > ## Clone to repo 1 278s > repo_1 <- clone(path_bare, path_repo_1) 278s cloning into '/tmp/Rtmp3k82Zs/git2r-7331e52ced9'... 278s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 278s > 278s > ## Add changes to repo 1 and push to bare 278s > writeLines( 278s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 278s + con = file.path(path_repo_1, "test.txt")) 278s > add(repo_1, "test.txt") 278s > commit(repo_1, "First commit message") 278s [2f75505] 2025-03-15: First commit message 278s > branch_name <- branches(repo_1)[[1]]$name 278s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 278s > 278s > ## Test checkout branch argument 278s > tools::assertError(checkout(repo_1)) 278s > tools::assertError(checkout(repo_1, c("master", "master"))) 278s > tools::assertError(checkout(repo_1, "dev")) 278s > 278s > ## Create and checkout dev branch in repo 1 278s > checkout(repo_1, "dev", create = TRUE) 278s > 278s > ## Add changes to dev branch in repo 1 and push to bare 278s > writeLines( 278s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 278s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 278s + con = file.path(path_repo_1, "test.txt")) 278s > add(repo_1, "test.txt") 278s > commit(repo_1, "Second commit message") 278s [7160955] 2025-03-15: Second commit message 278s > push(repo_1, "origin", "refs/heads/dev") 278s > 278s > ## Clone to repo 2 278s > repo_2 <- clone(path_bare, path_repo_2) 278s cloning into '/tmp/Rtmp3k82Zs/git2r-7336e9fc98d'... 278s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 278s > 278s > stopifnot(identical( 278s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 278s + readLines(file.path(path_repo_2, "test.txt")))) 278s > 278s > ## Checkout dev branch 278s > checkout(repo_2, "dev") 278s > 278s > ## Check content of file 278s > stopifnot(identical( 278s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 278s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 278s + readLines(file.path(path_repo_2, "test.txt")))) 278s > 278s > ## Checkout previous branch 278s > checkout(repo_2, "-") 278s > stopifnot(identical(repository_head(repo_2)$name, branch_name)) 278s > 278s > ## Cleanup 278s > unlink(path_bare, recursive = TRUE) 278s > unlink(path_repo_1, recursive = TRUE) 278s > unlink(path_repo_2, recursive = TRUE) 278s > 278s BEGIN TEST checkout.R 278s 278s R version 4.4.3 (2025-02-28) -- "Trophy Case" 278s Copyright (C) 2025 The R Foundation for Statistical Computing 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s 278s R is free software and comes with ABSOLUTELY NO WARRANTY. 278s You are welcome to redistribute it under certain conditions. 278s Type 'license()' or 'licence()' for distribution details. 278s 278s R is a collaborative project with many contributors. 278s Type 'contributors()' for more information and 278s 'citation()' on how to cite R or R packages in publications. 278s 278s Type 'demo()' for some demos, 'help()' for on-line help, or 278s 'help.start()' for an HTML browser interface to help. 278s Type 'q()' to quit R. 278s 278s > ## git2r, R bindings to the libgit2 library. 278s > ## Copyright (C) 2013-2023 The git2r contributors 278s > ## 278s > ## This program is free software; you can redistribute it and/or modify 278s > ## it under the terms of the GNU General Public License, version 2, 278s > ## as published by the Free Software Foundation. 278s > ## 278s > ## git2r is distributed in the hope that it will be useful, 278s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 278s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 278s > ## GNU General Public License for more details. 278s > ## 278s > ## You should have received a copy of the GNU General Public License along 278s > ## with this program; if not, write to the Free Software Foundation, Inc., 278s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 278s > 278s > library(git2r) 278s > 278s > ## For debugging 278s > sessionInfo() 278s R version 4.4.3 (2025-02-28) 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s Running under: Ubuntu Plucky Puffin (development branch) 278s 278s Matrix products: default 278s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 278s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 278s 278s locale: 278s [1] C 278s 278s time zone: Etc/UTC 278s tzcode source: system (glibc) 278s 278s attached base packages: 278s [1] stats graphics grDevices utils datasets methods base 278s 278s other attached packages: 278s [1] git2r_0.35.0 278s 278s loaded via a namespace (and not attached): 278s [1] compiler_4.4.3 278s > libgit2_version() 278s $major 278s [1] 1 278s 278s $minor 278s [1] 9 278s 278s $rev 278s [1] 0 278s 278s > libgit2_features() 278s $threads 278s [1] TRUE 278s 278s $https 278s [1] TRUE 278s 278s $ssh 278s [1] TRUE 278s 278s > 278s > 278s > ## Create a directory in tempdir 278s > path <- tempfile(pattern = "git2r-") 278s > dir.create(path) 278s > 278s > ## Initialize a repository 278s > repo <- init(path, branch = "main") 278s > config(repo, user.name = "Alice", user.email = "alice@example.org") 278s > 278s > ## Create first commit 278s > writeLines("Hello world!", file.path(path, "test.txt")) 278s > add(repo, "test.txt") 278s > commit_1 <- commit(repo, "First commit message") 278s > 278s > ## Edit file and checkout 278s > writeLines(c("Hello world!", "Hello world!"), file.path(path, "test.txt")) 278s > status_exp_1 <- structure(list(staged = structure(list(), 278s + .Names = character(0)), 278s + unstaged = structure(list(modified = "test.txt"), 278s + .Names = "modified"), 278s + untracked = structure(list(), 278s + .Names = character(0))), 278s + .Names = c("staged", "unstaged", "untracked"), 278s + class = "git_status") 278s > status_obs_1 <- status(repo) 278s > str(status_exp_1) 278s List of 3 278s $ staged : Named list() 278s $ unstaged :List of 1 278s ..$ modified: chr "test.txt" 278s $ untracked: Named list() 278s - attr(*, "class")= chr "git_status" 278s > str(status_obs_1) 278s List of 3 278s $ staged : Named list() 278s $ unstaged :List of 1 278s ..$ modified: chr "test.txt" 278s $ untracked: Named list() 278s - attr(*, "class")= chr "git_status" 278s > stopifnot(identical(status_obs_1, status_exp_1)) 278s > checkout(repo, path = "test.txt") 278s > status_exp_2 <- structure(list(staged = structure(list(), 278s + .Names = character(0)), 278s + unstaged = structure(list(), 278s + .Names = character(0)), 278s + untracked = structure(list(), 278s + .Names = character(0))), 278s + .Names = c("staged", "unstaged", "untracked"), 278s + class = "git_status") 278s > status_obs_2 <- status(repo) 278s > str(status_exp_2) 278s List of 3 278s $ staged : Named list() 278s $ unstaged : Named list() 278s $ untracked: Named list() 278s - attr(*, "class")= chr "git_status" 278s > str(status_obs_2) 278s List of 3 278s $ staged : Named list() 278s $ unstaged : Named list() 278s $ untracked: Named list() 278s - attr(*, "class")= chr "git_status" 278s > stopifnot(identical(status_obs_2, status_exp_2)) 278s > 278s > ## Create second commit 278s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 278s > add(repo, "test.txt") 278s > commit_2 <- commit(repo, "Second commit message") 278s > tag(repo, "commit_2", "Tag message") 278s > 278s > ## Create third commit 278s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 278s + file.path(path, "test.txt")) 278s > add(repo, "test.txt") 278s > commit_3 <- commit(repo, "Third commit message") 278s > 278s > ## Check HEAD 278s > stopifnot(identical(is_detached(repo), FALSE)) 278s > stopifnot(identical(repository_head(repo)$name, "main")) 278s > 278s > ## Check show and summary 278s > repo 278s Local: main /tmp/Rtmpd7l6k3/git2r-73f393710f5 278s Head: [c8ed424] 2025-03-15: Third commit message 278s > summary(repo) 278s Local: main /tmp/Rtmpd7l6k3/git2r-73f393710f5 278s Head: [c8ed424] 2025-03-15: Third commit message 278s 278s Branches: 1 278s Tags: 1 278s Commits: 3 278s Contributors: 1 278s Stashes: 0 278s Ignored files: 0 278s Untracked files: 0 278s Unstaged files: 0 278s Staged files: 0 278s 278s Latest commits: 278s [c8ed424] 2025-03-15: Third commit message 278s [197e6dc] 2025-03-15: Second commit message 278s [eae4cea] 2025-03-15: First commit message 278s > 278s > ## Checkout first commit 278s > checkout(commit_1, TRUE) 278s > stopifnot(identical(is_detached(repo), TRUE)) 278s > stopifnot(identical(repository_head(repo), commit_1)) 278s > stopifnot(identical(readLines(file.path(path, "test.txt")), "Hello world!")) 278s > 278s > ## Check show and summary 278s > repo 278s Local: (detached) /tmp/Rtmpd7l6k3/git2r-73f393710f5 278s Head: [eae4cea] 2025-03-15: First commit message 278s > summary(repo) 278s Local: (detached) /tmp/Rtmpd7l6k3/git2r-73f393710f5 278s Head: [eae4cea] 2025-03-15: First commit message 278s 278s Branches: 1 278s Tags: 1 278s Commits: 1 278s Contributors: 1 278s Stashes: 0 278s Ignored files: 0 278s Untracked files: 0 278s Unstaged files: 0 278s Staged files: 0 278s 278s Latest commits: 278s [eae4cea] 2025-03-15: First commit message 278s > 278s > ## Checkout tag 278s > checkout(tags(repo)[[1]], TRUE) 278s > stopifnot(identical(is_detached(repo), TRUE)) 278s > stopifnot(identical(readLines(file.path(path, "test.txt")), 278s + c("Hello world!", "HELLO WORLD!"))) 278s > 278s > ## Check is_detached with missing repo argument 278s > wd <- setwd(path) 278s > stopifnot(identical(is_detached(), TRUE)) 278s > if (!is.null(wd)) 278s + setwd(wd) 278s > 278s > ## Cleanup 278s > unlink(path, recursive = TRUE) 278s > 278s BEGIN TEST checkout_branch.R 278s 278s R version 4.4.3 (2025-02-28) -- "Trophy Case" 278s Copyright (C) 2025 The R Foundation for Statistical Computing 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s 278s R is free software and comes with ABSOLUTELY NO WARRANTY. 278s You are welcome to redistribute it under certain conditions. 278s Type 'license()' or 'licence()' for distribution details. 278s 278s R is a collaborative project with many contributors. 278s Type 'contributors()' for more information and 278s 'citation()' on how to cite R or R packages in publications. 278s 278s Type 'demo()' for some demos, 'help()' for on-line help, or 278s 'help.start()' for an HTML browser interface to help. 278s Type 'q()' to quit R. 278s 278s > ## git2r, R bindings to the libgit2 library. 278s > ## Copyright (C) 2013-2023 The git2r contributors 278s > ## 278s > ## This program is free software; you can redistribute it and/or modify 278s > ## it under the terms of the GNU General Public License, version 2, 278s > ## as published by the Free Software Foundation. 278s > ## 278s > ## git2r is distributed in the hope that it will be useful, 278s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 278s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 278s > ## GNU General Public License for more details. 278s > ## 278s > ## You should have received a copy of the GNU General Public License along 278s > ## with this program; if not, write to the Free Software Foundation, Inc., 278s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 278s > 278s > library(git2r) 278s > 278s > ## For debugging 278s > sessionInfo() 278s R version 4.4.3 (2025-02-28) 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s Running under: Ubuntu Plucky Puffin (development branch) 278s 278s Matrix products: default 278s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 278s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 278s 278s locale: 278s [1] C 278s 278s time zone: Etc/UTC 278s tzcode source: system (glibc) 278s 278s attached base packages: 278s [1] stats graphics grDevices utils datasets methods base 278s 278s other attached packages: 278s [1] git2r_0.35.0 278s 278s loaded via a namespace (and not attached): 278s [1] compiler_4.4.3 278s > libgit2_version() 278s $major 278s [1] 1 278s 278s $minor 278s [1] 9 278s 278s $rev 278s [1] 0 278s 278s > libgit2_features() 278s $threads 278s [1] TRUE 278s 278s $https 278s [1] TRUE 278s 278s $ssh 278s [1] TRUE 278s 278s > 278s > 278s > ## Create a directory in tempdir 278s > path <- tempfile(pattern = "git2r-") 278s > dir.create(path) 278s > 278s > ## Initialize a repository 278s > repo <- init(path, branch = "main") 278s > config(repo, user.name = "Alice", user.email = "alice@example.org") 278s > 278s > ## Create first commit 278s > writeLines("Hello world!", file.path(path, "test-1.txt")) 278s > add(repo, "test-1.txt") 278s > commit(repo, "First commit message") 278s [e72b744] 2025-03-15: First commit message 278s > 278s > ## Create and checkout dev branch in repo 278s > checkout(repo, "dev", create = TRUE) 278s > 278s > ## Create second commit 278s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 278s > add(repo, "test-2.txt") 278s > commit(repo, "Second commit message") 278s [9967029] 2025-03-15: Second commit message 278s > 278s > ## Check files 278s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 278s > 278s > ## Checkout master branch and check files 278s > checkout(repo, "main") 278s > stopifnot(identical(list.files(path), "test-1.txt")) 278s > 278s > ## Cleanup 278s > unlink(path, recursive = TRUE) 278s > 278s > ## Checkout branch in empty repository 278s > 278s > ## Create a directory in tempdir 278s > path <- tempfile(pattern = "git2r-") 278s > dir.create(path) 278s > 278s > ## Initialize a repository 278s > repo <- init(path) 278s > config(repo, user.name = "Alice", user.email = "alice@example.org") 278s > 278s > ## Create and checkout dev branch in repo 278s > checkout(repo, "dev", create = TRUE) 278s > 278s > ## Create first commit 278s > writeLines("Hello world!", file.path(path, "test-1.txt")) 278s > add(repo, "test-1.txt") 278s > commit(repo, "First commit message") 278s [e72b744] 2025-03-15: First commit message 278s > 278s > stopifnot(identical(length(branches(repo)), 1L)) 278s > stopifnot(identical(branches(repo)[[1]]$name, "dev")) 278s > 278s > ## Cleanup 278s > unlink(path, recursive = TRUE) 278s > 278s BEGIN TEST checkout_commit.R 278s 278s R version 4.4.3 (2025-02-28) -- "Trophy Case" 278s Copyright (C) 2025 The R Foundation for Statistical Computing 278s Platform: arm-unknown-linux-gnueabihf (32-bit) 278s 278s R is free software and comes with ABSOLUTELY NO WARRANTY. 278s You are welcome to redistribute it under certain conditions. 278s Type 'license()' or 'licence()' for distribution details. 278s 278s R is a collaborative project with many contributors. 278s Type 'contributors()' for more information and 278s 'citation()' on how to cite R or R packages in publications. 278s 278s Type 'demo()' for some demos, 'help()' for on-line help, or 278s 'help.start()' for an HTML browser interface to help. 278s Type 'q()' to quit R. 278s 279s > ## git2r, R bindings to the libgit2 library. 279s > ## Copyright (C) 2013-2023 The git2r contributors 279s > ## 279s > ## This program is free software; you can redistribute it and/or modify 279s > ## it under the terms of the GNU General Public License, version 2, 279s > ## as published by the Free Software Foundation. 279s > ## 279s > ## git2r is distributed in the hope that it will be useful, 279s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 279s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 279s > ## GNU General Public License for more details. 279s > ## 279s > ## You should have received a copy of the GNU General Public License along 279s > ## with this program; if not, write to the Free Software Foundation, Inc., 279s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 279s > 279s > library("git2r") 279s > 279s > ## For debugging 279s > sessionInfo() 279s R version 4.4.3 (2025-02-28) 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s Running under: Ubuntu Plucky Puffin (development branch) 279s 279s Matrix products: default 279s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 279s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 279s 279s locale: 279s [1] C 279s 279s time zone: Etc/UTC 279s tzcode source: system (glibc) 279s 279s attached base packages: 279s [1] stats graphics grDevices utils datasets methods base 279s 279s other attached packages: 279s [1] git2r_0.35.0 279s 279s loaded via a namespace (and not attached): 279s [1] compiler_4.4.3 279s > libgit2_version() 279s $major 279s [1] 1 279s 279s $minor 279s [1] 9 279s 279s $rev 279s [1] 0 279s 279s > libgit2_features() 279s $threads 279s [1] TRUE 279s 279s $https 279s [1] TRUE 279s 279s $ssh 279s [1] TRUE 279s 279s > 279s > 279s > ## Create a directory in tempdir 279s > path <- tempfile(pattern = "git2r-") 279s > dir.create(path) 279s > 279s > ## Initialize a repository 279s > repo <- init(path) 279s > config(repo, user.name = "Alice", user.email = "alice@example.org") 279s > 279s > ## Create first commit 279s > writeLines("Hello world!", file.path(path, "test-1.txt")) 279s > add(repo, "test-1.txt") 279s > commit_1 <- commit(repo, "First commit message") 279s > 279s > ## Create and checkout dev branch in repo 279s > checkout(repo, "dev", create = TRUE) 279s > 279s > ## Create second commit 279s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 279s > add(repo, "test-2.txt") 279s > commit_2 <- commit(repo, "Second commit message") 279s > 279s > ## Check files 279s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 279s > 279s > ## Checkout commit_1 and check files 279s > checkout(commit_1) 279s > stopifnot(identical(list.files(path), "test-1.txt")) 279s > 279s > ## Checkout commit_2 and check files 279s > checkout(commit_2) 279s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 279s > 279s > ## Cleanup 279s > unlink(path, recursive = TRUE) 279s > 279s BEGIN TEST checkout_tag.R 279s 279s R version 4.4.3 (2025-02-28) -- "Trophy Case" 279s Copyright (C) 2025 The R Foundation for Statistical Computing 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s 279s R is free software and comes with ABSOLUTELY NO WARRANTY. 279s You are welcome to redistribute it under certain conditions. 279s Type 'license()' or 'licence()' for distribution details. 279s 279s R is a collaborative project with many contributors. 279s Type 'contributors()' for more information and 279s 'citation()' on how to cite R or R packages in publications. 279s 279s Type 'demo()' for some demos, 'help()' for on-line help, or 279s 'help.start()' for an HTML browser interface to help. 279s Type 'q()' to quit R. 279s 279s > ## git2r, R bindings to the libgit2 library. 279s > ## Copyright (C) 2013-2023 The git2r contributors 279s > ## 279s > ## This program is free software; you can redistribute it and/or modify 279s > ## it under the terms of the GNU General Public License, version 2, 279s > ## as published by the Free Software Foundation. 279s > ## 279s > ## git2r is distributed in the hope that it will be useful, 279s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 279s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 279s > ## GNU General Public License for more details. 279s > ## 279s > ## You should have received a copy of the GNU General Public License along 279s > ## with this program; if not, write to the Free Software Foundation, Inc., 279s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 279s > 279s > library(git2r) 279s > 279s > ## For debugging 279s > sessionInfo() 279s R version 4.4.3 (2025-02-28) 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s Running under: Ubuntu Plucky Puffin (development branch) 279s 279s Matrix products: default 279s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 279s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 279s 279s locale: 279s [1] C 279s 279s time zone: Etc/UTC 279s tzcode source: system (glibc) 279s 279s attached base packages: 279s [1] stats graphics grDevices utils datasets methods base 279s 279s other attached packages: 279s [1] git2r_0.35.0 279s 279s loaded via a namespace (and not attached): 279s [1] compiler_4.4.3 279s > libgit2_version() 279s $major 279s [1] 1 279s 279s $minor 279s [1] 9 279s 279s $rev 279s [1] 0 279s 279s > libgit2_features() 279s $threads 279s [1] TRUE 279s 279s $https 279s [1] TRUE 279s 279s $ssh 279s [1] TRUE 279s 279s > 279s > 279s > ## Create a directory in tempdir 279s > path <- tempfile(pattern = "git2r-") 279s > dir.create(path) 279s > 279s > ## Initialize a repository 279s > repo <- init(path) 279s > config(repo, user.name = "Alice", user.email = "alice@example.org") 279s > 279s > ## Create first commit 279s > writeLines("Hello world!", file.path(path, "test-1.txt")) 279s > add(repo, "test-1.txt") 279s > commit_1 <- commit(repo, "First commit message") 279s > tag_1 <- tag(repo, "Tag1", "First tag message") 279s > 279s > ## Create and checkout dev branch in repo 279s > checkout(repo, "dev", create = TRUE) 279s > 279s > ## Create second commit 279s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 279s > add(repo, "test-2.txt") 279s > commit_2 <- commit(repo, "Second commit message") 279s > tag_2 <- tag(repo, "Tag2", "Second tag message") 279s > 279s > ## Check files 279s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 279s > 279s > ## Checkout tag_1 and check files 279s > checkout(tag_1) 279s > stopifnot(identical(list.files(path), "test-1.txt")) 279s > 279s > ## Checkout tag_2 and check files 279s > checkout(tag_2) 279s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 279s > 279s > ## Checkout "Tag1" and check files 279s > checkout(repo, "Tag1") 279s > stopifnot(identical(list.files(path), "test-1.txt")) 279s > 279s > ## Cleanup 279s > unlink(path, recursive = TRUE) 279s > 279s BEGIN TEST clone_bare.R 279s 279s R version 4.4.3 (2025-02-28) -- "Trophy Case" 279s Copyright (C) 2025 The R Foundation for Statistical Computing 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s 279s R is free software and comes with ABSOLUTELY NO WARRANTY. 279s You are welcome to redistribute it under certain conditions. 279s Type 'license()' or 'licence()' for distribution details. 279s 279s R is a collaborative project with many contributors. 279s Type 'contributors()' for more information and 279s 'citation()' on how to cite R or R packages in publications. 279s 279s Type 'demo()' for some demos, 'help()' for on-line help, or 279s 'help.start()' for an HTML browser interface to help. 279s Type 'q()' to quit R. 279s 279s > ## git2r, R bindings to the libgit2 library. 279s > ## Copyright (C) 2013-2023 The git2r contributors 279s > ## 279s > ## This program is free software; you can redistribute it and/or modify 279s > ## it under the terms of the GNU General Public License, version 2, 279s > ## as published by the Free Software Foundation. 279s > ## 279s > ## git2r is distributed in the hope that it will be useful, 279s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 279s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 279s > ## GNU General Public License for more details. 279s > ## 279s > ## You should have received a copy of the GNU General Public License along 279s > ## with this program; if not, write to the Free Software Foundation, Inc., 279s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 279s > 279s > library("git2r") 279s > 279s > ## For debugging 279s > sessionInfo() 279s R version 4.4.3 (2025-02-28) 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s Running under: Ubuntu Plucky Puffin (development branch) 279s 279s Matrix products: default 279s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 279s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 279s 279s locale: 279s [1] C 279s 279s time zone: Etc/UTC 279s tzcode source: system (glibc) 279s 279s attached base packages: 279s [1] stats graphics grDevices utils datasets methods base 279s 279s other attached packages: 279s [1] git2r_0.35.0 279s 279s loaded via a namespace (and not attached): 279s [1] compiler_4.4.3 279s > libgit2_version() 279s $major 279s [1] 1 279s 279s $minor 279s [1] 9 279s 279s $rev 279s [1] 0 279s 279s > libgit2_features() 279s $threads 279s [1] TRUE 279s 279s $https 279s [1] TRUE 279s 279s $ssh 279s [1] TRUE 279s 279s > 279s > 279s > ## Create 2 directories in tempdir 279s > path_bare <- tempfile(pattern = "git2r-") 279s > path_repo <- tempfile(pattern = "git2r-") 279s > dir.create(path_bare) 279s > dir.create(path_repo) 279s > 279s > ## Initialize a repository 279s > repo <- init(path_repo) 279s > config(repo, user.name = "Alice", user.email = "alice@example.org") 279s > 279s > ## Add commit to repo 279s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 279s > add(repo, "test.txt") 279s > commit_1 <- commit(repo, "Commit message") 279s > 279s > ## Check bare argument 279s > tools::assertError(clone(path_repo, path_bare, bare = c(TRUE, TRUE))) 279s > tools::assertError(clone(path_repo, path_bare, bare = 1)) 279s > tools::assertError(clone(path_repo, path_bare, bare = 1L)) 279s > tools::assertError(clone(path_repo, path_bare, bare = "test")) 279s > 279s > ## Clone repo to bare repository 279s > bare_repo <- clone(path_repo, path_bare, bare = TRUE) 279s cloning into '/tmp/RtmpXnx64a/git2r-76f16c45d44'... 279s > 279s > ## Check the repositores 279s > stopifnot(identical(is_bare(bare_repo), TRUE)) 279s > stopifnot(identical(is_bare(repo), FALSE)) 279s > 279s > ## Check result in bare repository 279s > stopifnot(identical(length(commits(bare_repo)), 1L)) 279s > bare_commit_1 <- commits(bare_repo)[[1]] 279s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 279s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 279s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 279s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 279s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 279s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 279s > 279s > ## Cleanup 279s > unlink(path_bare, recursive = TRUE) 279s > unlink(path_repo, recursive = TRUE) 279s > 279s BEGIN TEST clone_branch.R 279s 279s R version 4.4.3 (2025-02-28) -- "Trophy Case" 279s Copyright (C) 2025 The R Foundation for Statistical Computing 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s 279s R is free software and comes with ABSOLUTELY NO WARRANTY. 279s You are welcome to redistribute it under certain conditions. 279s Type 'license()' or 'licence()' for distribution details. 279s 279s R is a collaborative project with many contributors. 279s Type 'contributors()' for more information and 279s 'citation()' on how to cite R or R packages in publications. 279s 279s Type 'demo()' for some demos, 'help()' for on-line help, or 279s 'help.start()' for an HTML browser interface to help. 279s Type 'q()' to quit R. 279s 279s > ## git2r, R bindings to the libgit2 library. 279s > ## Copyright (C) 2013-2023 The git2r contributors 279s > ## 279s > ## This program is free software; you can redistribute it and/or modify 279s > ## it under the terms of the GNU General Public License, version 2, 279s > ## as published by the Free Software Foundation. 279s > ## 279s > ## git2r is distributed in the hope that it will be useful, 279s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 279s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 279s > ## GNU General Public License for more details. 279s > ## 279s > ## You should have received a copy of the GNU General Public License along 279s > ## with this program; if not, write to the Free Software Foundation, Inc., 279s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 279s > 279s > library(git2r) 279s > 279s > ## For debugging 279s > sessionInfo() 279s R version 4.4.3 (2025-02-28) 279s Platform: arm-unknown-linux-gnueabihf (32-bit) 279s Running under: Ubuntu Plucky Puffin (development branch) 279s 279s Matrix products: default 279s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 279s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 279s 279s locale: 279s [1] C 279s 279s time zone: Etc/UTC 279s tzcode source: system (glibc) 279s 279s attached base packages: 279s [1] stats graphics grDevices utils datasets methods base 279s 279s other attached packages: 279s [1] git2r_0.35.0 279s 279s loaded via a namespace (and not attached): 279s [1] compiler_4.4.3 279s > libgit2_version() 279s $major 279s [1] 1 279s 279s $minor 279s [1] 9 279s 279s $rev 279s [1] 0 279s 279s > libgit2_features() 279s $threads 279s [1] TRUE 279s 279s $https 279s [1] TRUE 279s 279s $ssh 279s [1] TRUE 279s 279s > 279s > 279s > ## Create directories for repositories in tempdir 279s > path_bare <- tempfile(pattern = "git2r-") 279s > path_repo_1 <- tempfile(pattern = "git2r-") 279s > path_repo_2 <- tempfile(pattern = "git2r-") 279s > 279s > dir.create(path_bare) 279s > dir.create(path_repo_1) 279s > dir.create(path_repo_2) 279s > 279s > ## Create bare repository 279s > bare_repo <- init(path_bare, bare = TRUE) 279s > 279s > ## Clone to repo 1 279s > repo_1 <- clone(path_bare, path_repo_1) 279s cloning into '/tmp/Rtmp1IzMdr/git2r-77b175800f2'... 279s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 279s > 279s > ## Add changes to repo 1 279s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 279s + con = file.path(path_repo_1, "test-1.txt")) 279s > add(repo_1, "test-1.txt") 279s > commit_1 <- commit(repo_1, "First commit message") 279s > branch_name <- branches(repo_1)[[1]]$name 279s > 279s > ## Create 'dev' branch 279s > checkout(branch_create(commit_1, name = "dev")) 279s > 279s > ## Add more changes to repo 1 279s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 279s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 279s + con = file.path(path_repo_1, "test-1.txt")) 279s > add(repo_1, "test-1.txt") 279s > commit(repo_1, "Second commit message") 279s [7443afb] 2025-03-15: Second commit message 279s > 279s > ## Add more changes to repo 1 279s > writeLines( 279s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 279s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 279s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 279s + con = file.path(path_repo_1, "test-1.txt")) 279s > add(repo_1, "test-1.txt") 279s > commit(repo_1, "Third commit message") 279s [c89f139] 2025-03-15: Third commit message 279s > 279s > ## Push to bare 279s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 279s > push(repo_1, "origin", "refs/heads/dev") 279s > 279s > ## Print branch 279s > branches(repo_1)[[paste0("origin/", branch_name)]] 279s [c16e1e] (origin @ /tmp/Rtmp1IzMdr/git2r-77b7c28a622) master 279s > 279s > ## Clone to repo 2 279s > repo_2 <- clone(url = path_bare, local_path = path_repo_2, branch = "dev") 279s cloning into '/tmp/Rtmp1IzMdr/git2r-77b2661f43c'... 279s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 279s > 279s > ## Check branch and commits 279s > stopifnot(identical(length(commits(repo_2)), 3L)) 279s > stopifnot(identical(repository_head(repo_2)$name, "dev")) 279s > 279s > ## Cleanup 279s > unlink(path_bare, recursive = TRUE) 279s > unlink(path_repo_1, recursive = TRUE) 279s > unlink(path_repo_2, recursive = TRUE) 279s > 279s BEGIN TEST clone_checkout.R 280s 280s R version 4.4.3 (2025-02-28) -- "Trophy Case" 280s Copyright (C) 2025 The R Foundation for Statistical Computing 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s 280s R is free software and comes with ABSOLUTELY NO WARRANTY. 280s You are welcome to redistribute it under certain conditions. 280s Type 'license()' or 'licence()' for distribution details. 280s 280s R is a collaborative project with many contributors. 280s Type 'contributors()' for more information and 280s 'citation()' on how to cite R or R packages in publications. 280s 280s Type 'demo()' for some demos, 'help()' for on-line help, or 280s 'help.start()' for an HTML browser interface to help. 280s Type 'q()' to quit R. 280s 280s > ## git2r, R bindings to the libgit2 library. 280s > ## Copyright (C) 2013-2023 The git2r contributors 280s > ## 280s > ## This program is free software; you can redistribute it and/or modify 280s > ## it under the terms of the GNU General Public License, version 2, 280s > ## as published by the Free Software Foundation. 280s > ## 280s > ## git2r is distributed in the hope that it will be useful, 280s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 280s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 280s > ## GNU General Public License for more details. 280s > ## 280s > ## You should have received a copy of the GNU General Public License along 280s > ## with this program; if not, write to the Free Software Foundation, Inc., 280s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 280s > 280s > library("git2r") 280s > 280s > ## For debugging 280s > sessionInfo() 280s R version 4.4.3 (2025-02-28) 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s Running under: Ubuntu Plucky Puffin (development branch) 280s 280s Matrix products: default 280s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 280s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 280s 280s locale: 280s [1] C 280s 280s time zone: Etc/UTC 280s tzcode source: system (glibc) 280s 280s attached base packages: 280s [1] stats graphics grDevices utils datasets methods base 280s 280s other attached packages: 280s [1] git2r_0.35.0 280s 280s loaded via a namespace (and not attached): 280s [1] compiler_4.4.3 280s > libgit2_version() 280s $major 280s [1] 1 280s 280s $minor 280s [1] 9 280s 280s $rev 280s [1] 0 280s 280s > libgit2_features() 280s $threads 280s [1] TRUE 280s 280s $https 280s [1] TRUE 280s 280s $ssh 280s [1] TRUE 280s 280s > 280s > 280s > ## Create 2 directories in tempdir 280s > path_src <- tempfile(pattern = "git2r-") 280s > path_tgt <- tempfile(pattern = "git2r-") 280s > dir.create(path_tgt) 280s > dir.create(path_src) 280s > 280s > ## Initialize a repository 280s > repo_src <- init(path_src) 280s > config(repo_src, user.name = "Alice", user.email = "alice@example.org") 280s > 280s > ## Add commit to repo 280s > filename <- "test.txt" 280s > writeLines("Hello world", con = file.path(path_src, filename)) 280s > add(repo_src, "test.txt") 280s > commit_src <- commit(repo_src, "Commit message") 280s > 280s > ## Check checkout argument 280s > tools::assertError(clone(path_src, path_tgt, checkout = c(FALSE, TRUE))) 280s > tools::assertError(clone(path_src, path_tgt, checkout = 1)) 280s > tools::assertError(clone(path_src, path_tgt, checkout = 1L)) 280s > tools::assertError(clone(path_src, path_tgt, checkout = "test")) 280s > 280s > ## Clone source to target repository without checking out any files 280s > repo_tgt <- clone(path_src, path_tgt, checkout = FALSE) 280s cloning into '/tmp/RtmpOiwBSH/git2r-787175020c6'... 280s > 280s > ## List files in the repositores 280s > stopifnot(identical(list.files(path_src), filename)) 280s > stopifnot(identical(list.files(path_tgt), character(0))) 280s > 280s > ## Compare commits 280s > stopifnot(identical(length(commits(repo_tgt)), 1L)) 280s > commit_tgt <- last_commit(repo_tgt) 280s > stopifnot(identical(sha(last_commit(path_tgt)), sha(commit_tgt))) 280s > stopifnot(identical(sha(commit_src), sha(commit_tgt))) 280s > stopifnot(identical(commit_src$author, commit_tgt$author)) 280s > stopifnot(identical(commit_src$committer, commit_tgt$committer)) 280s > stopifnot(identical(commit_src$summary, commit_tgt$summary)) 280s > stopifnot(identical(commit_src$message, commit_tgt$message)) 280s > stopifnot(!identical(commit_src$repo, commit_tgt$repo)) 280s > 280s > ## Cleanup 280s > unlink(path_tgt, recursive = TRUE) 280s > unlink(path_src, recursive = TRUE) 280s > 280s BEGIN TEST commit.R 280s 280s R version 4.4.3 (2025-02-28) -- "Trophy Case" 280s Copyright (C) 2025 The R Foundation for Statistical Computing 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s 280s R is free software and comes with ABSOLUTELY NO WARRANTY. 280s You are welcome to redistribute it under certain conditions. 280s Type 'license()' or 'licence()' for distribution details. 280s 280s R is a collaborative project with many contributors. 280s Type 'contributors()' for more information and 280s 'citation()' on how to cite R or R packages in publications. 280s 280s Type 'demo()' for some demos, 'help()' for on-line help, or 280s 'help.start()' for an HTML browser interface to help. 280s Type 'q()' to quit R. 280s 280s > ## git2r, R bindings to the libgit2 library. 280s > ## Copyright (C) 2013-2023 The git2r contributors 280s > ## 280s > ## This program is free software; you can redistribute it and/or modify 280s > ## it under the terms of the GNU General Public License, version 2, 280s > ## as published by the Free Software Foundation. 280s > ## 280s > ## git2r is distributed in the hope that it will be useful, 280s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 280s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 280s > ## GNU General Public License for more details. 280s > ## 280s > ## You should have received a copy of the GNU General Public License along 280s > ## with this program; if not, write to the Free Software Foundation, Inc., 280s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 280s > 280s > library(git2r) 280s > source("util/check.R") 280s > 280s > ## For debugging 280s > sessionInfo() 280s R version 4.4.3 (2025-02-28) 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s Running under: Ubuntu Plucky Puffin (development branch) 280s 280s Matrix products: default 280s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 280s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 280s 280s locale: 280s [1] C 280s 280s time zone: Etc/UTC 280s tzcode source: system (glibc) 280s 280s attached base packages: 280s [1] stats graphics grDevices utils datasets methods base 280s 280s other attached packages: 280s [1] git2r_0.35.0 280s 280s loaded via a namespace (and not attached): 280s [1] compiler_4.4.3 280s > libgit2_version() 280s $major 280s [1] 1 280s 280s $minor 280s [1] 9 280s 280s $rev 280s [1] 0 280s 280s > libgit2_features() 280s $threads 280s [1] TRUE 280s 280s $https 280s [1] TRUE 280s 280s $ssh 280s [1] TRUE 280s 280s > 280s > 280s > ## Create a directory in tempdir 280s > path <- tempfile(pattern = "git2r-") 280s > dir.create(path) 280s > 280s > ## Initialize a repository 280s > repo <- init(path) 280s > config(repo, user.name = "Alice", user.email = "alice@example.org") 280s > 280s > ## Commit without adding changes should produce an error 280s > tools::assertError(commit(repo, "Test to commit")) 280s > 280s > ## Create a file 280s > writeLines("Hello world!", file.path(path, "test.txt")) 280s > 280s > ## Commit without adding changes should produce an error 280s > tools::assertError(commit(repo, "Test to commit")) 280s > 280s > ## Add 280s > add(repo, "test.txt") 280s > 280s > ## Commit with empty message should produce an error 280s > tools::assertError(commit(repo, "")) 280s > 280s > ## Commit 280s > commit_1 <- commit(repo, "Commit message", session = TRUE) 280s > summary(commit_1) 280s Commit: 25fe7288acfc2dedffaa1c9167fc98008f71cc40 280s Author: Alice 280s When: 2025-03-15 16:15:09 GMT 280s 280s Commit message 280s 280s sessionInfo: 280s R version 4.4.3 (2025-02-28) 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s Running under: Ubuntu Plucky Puffin (development branch) 280s 280s Matrix products: default 280s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 280s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 280s 280s locale: 280s [1] C 280s 280s time zone: Etc/UTC 280s tzcode source: system (glibc) 280s 280s attached base packages: 280s [1] stats graphics grDevices utils datasets methods base 280s 280s other attached packages: 280s [1] git2r_0.35.0 280s 280s loaded via a namespace (and not attached): 280s [1] compiler_4.4.3 tools_4.4.3 280s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 280s > 280s > ## Check commit 280s > stopifnot(identical(commit_1$author$name, "Alice")) 280s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 280s > stopifnot(identical(lookup(repo, sha(commit_1)), commit_1)) 280s > stopifnot(identical(length(commits(repo)), 1L)) 280s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 280s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 280s > stopifnot(identical(parents(commit_1), list())) 280s > stopifnot(identical(print(commit_1), commit_1)) 280s [25fe728] 2025-03-15: Commit message 280s > 280s > ## Check is_commit 280s > stopifnot(identical(is_commit(commit_1), TRUE)) 280s > stopifnot(identical(is_commit(5), FALSE)) 280s > 280s > ## Commit without adding changes should produce an error 280s > tools::assertError(commit(repo, "Test to commit")) 280s > 280s > ## Add another commit 280s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 280s > add(repo, "test.txt") 280s > commit_2 <- commit(repo, "Commit message 2") 280s > summary(commit_2) 280s Commit: c1b73724dfb2f3b2dad6b6fc4ec6fc68559f2cd8 280s Author: Alice 280s When: 2025-03-15 16:15:09 GMT 280s 280s Commit message 2 280s 1 file changed, 1 insertions, 0 deletions 280s test.txt | -0 +1 in 1 hunk 280s 280s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 280s > 280s > ## Check relationship 280s > stopifnot(identical(descendant_of(commit_2, commit_1), TRUE)) 280s > stopifnot(identical(descendant_of(commit_1, commit_2), FALSE)) 280s > stopifnot(identical(descendant_of(tag_2, tag_1), TRUE)) 280s > stopifnot(identical(descendant_of(tag_1, tag_2), FALSE)) 280s > stopifnot(identical(descendant_of(branches(repo)[[1]], commit_1), TRUE)) 280s > stopifnot(identical(descendant_of(commit_1, branches(repo)[[1]]), FALSE)) 280s > stopifnot(identical(length(parents(commit_2)), 1L)) 280s > stopifnot(identical(parents(commit_2)[[1]], commit_1)) 280s > 280s > ## Check contributions 280s > stopifnot(identical( 280s + colnames(contributions(repo, by = "author", breaks = "day")), 280s + c("when", "author", "n"))) 280s > stopifnot(identical(colnames(contributions(repo)), 280s + c("when", "n"))) 280s > stopifnot(identical(nrow(contributions(repo)), 1L)) 280s > stopifnot(identical(contributions(repo)$n, 2L)) 280s > stopifnot(identical(contributions(repo, by = "author", breaks = "day")$n, 2L)) 280s > 280s > ## Add another commit with 'all' argument 280s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 280s + file.path(path, "test.txt")) 280s > commit(repo, "Commit message 3", all = TRUE) 280s [402ab55] 2025-03-15: Commit message 3 280s > 280s > status_clean <- structure(list(staged = empty_named_list(), 280s + unstaged = empty_named_list(), 280s + untracked = empty_named_list()), 280s + class = "git_status") 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > ## Delete file and commit with 'all' argument 280s > file.remove(file.path(path, "test.txt")) 280s [1] TRUE 280s > commit(repo, "Commit message 4", all = TRUE) 280s [fab1f79] 2025-03-15: Commit message 4 280s > 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > ## Add and commit multiple tracked files with 'all' argument 280s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 280s > add(repo, "test2.txt") 280s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 280s > add(repo, "test3.txt") 280s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 280s > add(repo, "test4.txt") 280s > commit(repo, "Commit message 5") 280s [72a536a] 2025-03-15: Commit message 5 280s > 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 280s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 280s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 280s > commit(repo, "Commit message 6", all = TRUE) 280s [38e13fb] 2025-03-15: Commit message 6 280s > 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > ## Add one tracked file and delete another with 'all' argument 280s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 280s > file.remove(file.path(path, "test4.txt")) 280s [1] TRUE 280s > commit(repo, "Commit message 7", all = TRUE) 280s [9f1cf58] 2025-03-15: Commit message 7 280s > 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > ## Delete multiple tracked files with 'all' argument 280s > file.remove(file.path(path, "test2.txt")) 280s [1] TRUE 280s > file.remove(file.path(path, "test3.txt")) 280s [1] TRUE 280s > commit(repo, "Commit message 8", all = TRUE) 280s [89bae5d] 2025-03-15: Commit message 8 280s > 280s > stopifnot(identical(status(repo), status_clean)) 280s > 280s > ## Check max number of commits in output 280s > stopifnot(identical(length(commits(repo)), 8L)) 280s > stopifnot(identical(length(commits(repo, n = -1)), 8L)) 280s > stopifnot(identical(length(commits(repo, n = 2)), 2L)) 280s > tools::assertError(commits(repo, n = 2.2)) 280s > tools::assertError(commits(repo, n = "2")) 280s > tools::assertError(commits(repo, n = 1:2)) 280s > 280s > ## Check to coerce repository to data.frame 280s > df <- as.data.frame(repo) 280s > stopifnot(identical(dim(df), c(8L, 6L))) 280s > stopifnot(identical(names(df), c("sha", "summary", "message", 280s + "author", "email", "when"))) 280s > 280s > ## Set working directory to path and check commits 280s > setwd(path) 280s > stopifnot(identical(sha(last_commit()), sha(commits(repo, n = 1)[[1]]))) 280s > stopifnot(identical(length(commits()), 8L)) 280s > stopifnot(identical(length(commits(n = -1)), 8L)) 280s > stopifnot(identical(length(commits(n = 2)), 2L)) 280s > tools::assertError(commits(n = 2.2)) 280s > tools::assertError(commits(n = "2")) 280s > 280s > ## Check plot method 280s > plot_file <- tempfile(fileext = ".pdf") 280s > pdf(plot_file) 280s > plot(repo) 280s > dev.off() 280s null device 280s 1 280s > stopifnot(file.exists(plot_file)) 280s > unlink(plot_file) 280s > 280s > ## Check punch card plot method 280s > punch_card_plot_file <- tempfile(fileext = ".pdf") 280s > pdf(punch_card_plot_file) 280s > punch_card(repo) 280s > dev.off() 280s null device 280s 1 280s > stopifnot(file.exists(punch_card_plot_file)) 280s > unlink(punch_card_plot_file) 280s > 280s > ## Check that 'git2r_arg_check_commit' raise error 280s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, NULL)) 280s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 280s + res[[1]]$message)) > 0) 280s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, 3)) 280s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 280s + res[[1]]$message)) > 0) 280s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, repo)) 280s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 280s + res[[1]]$message)) > 0) 280s > commit_1$sha <- NA_character_ 280s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, commit_1)) 280s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 280s + res[[1]]$message)) > 0) 280s > 280s > ## Cleanup 280s > unlink(path, recursive = TRUE) 280s > 280s > if (identical(Sys.getenv("NOT_CRAN"), "true") || 280s + identical(Sys.getenv("R_COVR"), "true")) { 280s + path <- tempfile(pattern = "git2r-") 280s + dir.create(path) 280s + setwd(path) 280s + system("git clone --depth 2 https://github.com/ropensci/git2r.git") 280s + 280s + ## Check the number of commits in the shallow clone. 280s + stopifnot(identical(length(commits(repository("git2r"))), 2L)) 280s + stopifnot(identical(length(commits(repository("git2r"), n = 1)), 1L)) 280s + 280s + ## Cleanup 280s + unlink(path, recursive = TRUE) 280s + } 280s > 280s sh: 0: getcwd() failed: No such file or directory 280s BEGIN TEST commits_path.R 280s 280s R version 4.4.3 (2025-02-28) -- "Trophy Case" 280s Copyright (C) 2025 The R Foundation for Statistical Computing 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s 280s R is free software and comes with ABSOLUTELY NO WARRANTY. 280s You are welcome to redistribute it under certain conditions. 280s Type 'license()' or 'licence()' for distribution details. 280s 280s R is a collaborative project with many contributors. 280s Type 'contributors()' for more information and 280s 'citation()' on how to cite R or R packages in publications. 280s 280s Type 'demo()' for some demos, 'help()' for on-line help, or 280s 'help.start()' for an HTML browser interface to help. 280s Type 'q()' to quit R. 280s 280s > ## git2r, R bindings to the libgit2 library. 280s > ## Copyright (C) 2013-2023 The git2r contributors 280s > ## 280s > ## This program is free software; you can redistribute it and/or modify 280s > ## it under the terms of the GNU General Public License, version 2, 280s > ## as published by the Free Software Foundation. 280s > ## 280s > ## git2r is distributed in the hope that it will be useful, 280s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 280s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 280s > ## GNU General Public License for more details. 280s > ## 280s > ## You should have received a copy of the GNU General Public License along 280s > ## with this program; if not, write to the Free Software Foundation, Inc., 280s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 280s > 280s > library(git2r) 280s > 280s > ## For debugging 280s > sessionInfo() 280s R version 4.4.3 (2025-02-28) 280s Platform: arm-unknown-linux-gnueabihf (32-bit) 280s Running under: Ubuntu Plucky Puffin (development branch) 280s 280s Matrix products: default 280s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 280s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 280s 280s locale: 280s [1] C 280s 280s time zone: Etc/UTC 280s tzcode source: system (glibc) 280s 280s attached base packages: 280s [1] stats graphics grDevices utils datasets methods base 280s 280s other attached packages: 280s [1] git2r_0.35.0 280s 280s loaded via a namespace (and not attached): 280s [1] compiler_4.4.3 280s > libgit2_version() 280s $major 280s [1] 1 280s 280s $minor 280s [1] 9 280s 280s $rev 280s [1] 0 280s 280s > libgit2_features() 280s $threads 280s [1] TRUE 280s 280s $https 280s [1] TRUE 280s 280s $ssh 280s [1] TRUE 280s 280s > 280s > 280s > ## Create a directory in tempdir 280s > path <- tempfile(pattern = "git2r-") 280s > dir.create(path) 280s > 280s > ## Initialize a repository 280s > repo <- init(path, branch = "main") 280s > config(repo, user.name = "Alice", user.email = "alice@example.org") 280s > 280s > ## Create two files and alternate commits 280s > writeLines("1", file.path(path, "odd.txt")) 280s > add(repo, "odd.txt") 280s > c1 <- commit(repo, "commit 1") 280s > 280s > writeLines("2", file.path(path, "even.txt")) 280s > add(repo, "even.txt") 280s > c2 <- commit(repo, "commit 2") 280s > 280s > writeLines("3", file.path(path, "odd.txt")) 280s > add(repo, "odd.txt") 280s > c3 <- commit(repo, "commit 3") 280s > 280s > writeLines("4", file.path(path, "even.txt")) 280s > add(repo, "even.txt") 280s > c4 <- commit(repo, "commit 4") 280s > 280s > writeLines("5", file.path(path, "odd.txt")) 280s > add(repo, "odd.txt") 280s > c5 <- commit(repo, "commit 5") 280s > 280s > writeLines("6", file.path(path, "even.txt")) 280s > add(repo, "even.txt") 280s > c6 <- commit(repo, "commit 6") 280s > 280s > commits_all <- commits(repo) 280s > stopifnot(length(commits_all) == 6) 280s > 280s > ## Test path 280s > commits_odd <- commits(repo, path = "odd.txt") 280s > stopifnot(length(commits_odd) == 3) 280s > stopifnot(commits_odd[[1]]$sha == c5$sha) 280s > stopifnot(commits_odd[[2]]$sha == c3$sha) 280s > stopifnot(commits_odd[[3]]$sha == c1$sha) 280s > 280s > commits_even <- commits(repo, path = "even.txt") 280s > stopifnot(length(commits_even) == 3) 280s > stopifnot(commits_even[[1]]$sha == c6$sha) 280s > stopifnot(commits_even[[2]]$sha == c4$sha) 280s > stopifnot(commits_even[[3]]$sha == c2$sha) 280s > 280s > ## Test reverse 280s > commits_odd_rev <- commits(repo, reverse = TRUE, path = "odd.txt") 280s > stopifnot(length(commits_odd_rev) == 3) 280s > stopifnot(commits_odd_rev[[1]]$sha == c1$sha) 280s > stopifnot(commits_odd_rev[[2]]$sha == c3$sha) 280s > stopifnot(commits_odd_rev[[3]]$sha == c5$sha) 280s > 280s > commits_even_rev <- commits(repo, reverse = TRUE, path = "even.txt") 280s > stopifnot(length(commits_even_rev) == 3) 280s > stopifnot(commits_even_rev[[1]]$sha == c2$sha) 280s > stopifnot(commits_even_rev[[2]]$sha == c4$sha) 280s > stopifnot(commits_even_rev[[3]]$sha == c6$sha) 280s > 280s > ## Test n 280s > commits_odd_n <- commits(repo, n = 2, path = "odd.txt") 280s > stopifnot(length(commits_odd_n) == 2) 280s > stopifnot(commits_odd_n[[1]]$sha == c5$sha) 280s > stopifnot(commits_odd_n[[2]]$sha == c3$sha) 280s > 280s > commits_even_n <- commits(repo, n = 2, path = "even.txt") 280s > stopifnot(length(commits_even_n) == 2) 280s > stopifnot(commits_even_n[[1]]$sha == c6$sha) 280s > stopifnot(commits_even_n[[2]]$sha == c4$sha) 280s > 280s > commits_odd_0 <- commits(repo, n = 0, path = "odd.txt") 280s > stopifnot(length(commits_odd_0) == 0) 280s > stopifnot(identical(commits_odd_0, list())) 280s > 280s > commits_even_0 <- commits(repo, n = 0, path = "even.txt") 280s > stopifnot(length(commits_even_0) == 0) 280s > stopifnot(identical(commits_even_0, list())) 280s > 280s > ## Test ref 280s > checkout(repo, branch = "test-ref", create = TRUE) 280s > 280s > writeLines("7", file.path(path, "odd.txt")) 280s > add(repo, "odd.txt") 280s > c7 <- commit(repo, "commit 7") 280s > 280s > writeLines("8", file.path(path, "even.txt")) 280s > add(repo, "even.txt") 280s > c8 <- commit(repo, "commit 8") 280s > 280s > commits_odd_ref <- commits(repo, ref = "main", path = "odd.txt") 280s > stopifnot(length(commits_odd_ref) == 3) 280s > stopifnot(commits_odd_ref[[1]]$sha == c5$sha) 280s > stopifnot(commits_odd_ref[[2]]$sha == c3$sha) 280s > stopifnot(commits_odd_ref[[3]]$sha == c1$sha) 280s > 280s > commits_even_ref <- commits(repo, ref = "main", path = "even.txt") 280s > stopifnot(length(commits_even_ref) == 3) 280s > stopifnot(commits_even_ref[[1]]$sha == c6$sha) 280s > stopifnot(commits_even_ref[[2]]$sha == c4$sha) 280s > stopifnot(commits_even_ref[[3]]$sha == c2$sha) 280s > 280s > checkout(repo, branch = "main") 280s > 280s > ## Test renaming a file (path does not support --follow) 280s > writeLines("a file to be renamed", file.path(path, "original.txt")) 280s > add(repo, "original.txt") 280s > c_original <- commit(repo, "commit original") 280s > 280s > commits_original <- commits(repo, path = "original.txt") 280s > stopifnot(length(commits_original) == 1) 280s > stopifnot(commits_original[[1]]$sha == c_original$sha) 280s > 280s > file.rename(file.path(path, "original.txt"), file.path(path, "new.txt")) 280s [1] TRUE 280s > add(repo, c("original.txt", "new.txt")) 280s > c_new <- commit(repo, "commit new") 280s > 280s > commits_new <- commits(repo, path = "new.txt") 280s > stopifnot(length(commits_new) == 1) 280s > stopifnot(commits_new[[1]]$sha == c_new$sha) 280s > 280s > ## Test merge commits 280s > writeLines(letters[1:5], file.path(path, "merge.txt")) 280s > add(repo, "merge.txt") 280s > c_merge_1 <- commit(repo, "commit merge 1") 280s > 280s > checkout(repo, branch = "test-merge", create = TRUE) 280s > cat("z", file = file.path(path, "merge.txt"), append = TRUE) 280s > add(repo, "merge.txt") 280s > c_merge_2 <- commit(repo, "commit merge 2") 280s > 280s > checkout(repo, branch = "main") 280s > writeLines(c("A", letters[2:5]), file.path(path, "merge.txt")) 280s > add(repo, "merge.txt") 280s > c_merge_3 <- commit(repo, "commit merge 3") 280s > 280s > c_merge_4 <- merge(repo, "test-merge") 280s > stopifnot(class(c_merge_4) == "git_merge_result") 280s > 280s > commits_merge <- commits(repo, path = "merge.txt") 280s > stopifnot(length(commits_merge) == 4) 280s > stopifnot(commits_merge[[1]]$sha == c_merge_4$sha) 280s > stopifnot(commits_merge[[2]]$sha == c_merge_3$sha) 280s > stopifnot(commits_merge[[3]]$sha == c_merge_2$sha) 280s > stopifnot(commits_merge[[4]]$sha == c_merge_1$sha) 280s > 280s > ## Test absolute path 280s > writeLines("absolute", file.path(path, "abs.txt")) 280s > add(repo, "abs.txt") 280s > c_abs <- commit(repo, "commit absolute") 280s > 280s > commits_abs <- commits(repo, path = file.path(path, "abs.txt")) 280s > stopifnot(length(commits_abs) == 1) 280s > stopifnot(commits_abs[[1]]$sha == c_abs$sha) 280s > 280s > ## Test topological and time 280s > ## Strategy: 280s > ## - Commit a new file test-time.txt 280s > ## - Commit a change on branch test-time-1 (a) 280s > ## - Commit a change on branch test-time-2 (c) 280s > ## - Commit a change on branch test-time-1 (b) 280s > ## - Commit a change on branch test-time-2 (d) 280s > ## - Merge branch test-time-2 into main (fast-forward) 280s > ## - Merge branch test-time-1 into main (merge commit) 280s > ## 280s > ## $ git log --all --decorate --oneline --graph -n 6 280s > ## * 79e6880 (HEAD -> main) merge test-time-1 280s > ## |\ 280s > ## | * e2f18f1 (test-time-1) commit b 280s > ## | * 5f34820 commit a 280s > ## * | b954ec9 (test-time-2) commit d 280s > ## * | 7ae2fd5 commit c 280s > ## |/ 280s > ## * 923f3ea commit base 280s > Sys.sleep(1) 281s > writeLines(as.character(1:100), file.path(path, "test-time.txt")) 281s > add(repo, "test-time.txt") 281s > c_base <- commit(repo, "commit base") 281s > Sys.sleep(1) 282s > branch_create(commit = c_base, name = "test-time-1") 282s > branch_create(commit = c_base, name = "test-time-2") 282s > 282s > checkout(repo, branch = "test-time-1") 282s > writeLines(c("edit", 2:100), file.path(path, "test-time.txt")) 282s > add(repo, "test-time.txt") 282s > c_a <- commit(repo, "commit a") 282s > Sys.sleep(1) 283s > 283s > checkout(repo, branch = "test-time-2") 283s > writeLines(c(1:25, "edit", 27:100), file.path(path, "test-time.txt")) 283s > add(repo, "test-time.txt") 283s > c_c <- commit(repo, "commit c") 283s > Sys.sleep(1) 285s > 285s > checkout(repo, branch = "test-time-1") 285s > writeLines(c(1:50, "edit", 52:100), file.path(path, "test-time.txt")) 285s > add(repo, "test-time.txt") 285s > c_b <- commit(repo, "commit b") 285s > Sys.sleep(1) 286s > 286s > checkout(repo, branch = "test-time-2") 286s > writeLines(c(1:75, "edit", 77:100), file.path(path, "test-time.txt")) 286s > add(repo, "test-time.txt") 286s > c_d <- commit(repo, "commit d") 286s > Sys.sleep(1) 287s > 287s > checkout(repo, branch = "main") 287s > merge(repo, "test-time-2") # Fast-forward 287s Merge: Fast-forward 287s > merge(repo, "test-time-1") # Merge commit 287s Merge 287s > c_merge_time <- commits(repo, n = 1)[[1]] 287s > 287s > ## topological - commits in test-time-2 come first because it was 287s > ## merged first 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 287s + list(c_merge_time, c_b, c_a, c_d, c_c, c_base) 287s + )) 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 287s + commits(repo, topological = TRUE, time = FALSE)[1:6] 287s + )) 287s > 287s > ## time - commits ordered by time they were created, not merged into 287s > ## main 287s > stopifnot(identical( 287s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 287s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 287s + )) 287s > stopifnot(identical( 287s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 287s + commits(repo, topological = FALSE, time = TRUE)[1:6] 287s + )) 287s > 287s > ## topological and time - dominated by time 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 287s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 287s + )) 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 287s + commits(repo, topological = TRUE, time = TRUE)[1:6] 287s + )) 287s > 287s > ## reverse with topological and/or time 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = FALSE, reverse = TRUE, 287s + path = "test-time.txt"), 287s + rev(list(c_merge_time, c_b, c_a, c_d, c_c, c_base)) 287s + )) 287s > stopifnot(identical( 287s + commits(repo, topological = FALSE, time = TRUE, reverse = TRUE, 287s + path = "test-time.txt"), 287s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 287s + )) 287s > stopifnot(identical( 287s + commits(repo, topological = TRUE, time = TRUE, reverse = TRUE, 287s + path = "test-time.txt"), 287s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 287s + )) 287s > 287s > ## Cleanup 287s > unlink(path, recursive = TRUE) 287s > 287s BEGIN TEST config.R 287s 287s R version 4.4.3 (2025-02-28) -- "Trophy Case" 287s Copyright (C) 2025 The R Foundation for Statistical Computing 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s 287s R is free software and comes with ABSOLUTELY NO WARRANTY. 287s You are welcome to redistribute it under certain conditions. 287s Type 'license()' or 'licence()' for distribution details. 287s 287s R is a collaborative project with many contributors. 287s Type 'contributors()' for more information and 287s 'citation()' on how to cite R or R packages in publications. 287s 287s Type 'demo()' for some demos, 'help()' for on-line help, or 287s 'help.start()' for an HTML browser interface to help. 287s Type 'q()' to quit R. 287s 287s > ## git2r, R bindings to the libgit2 library. 287s > ## Copyright (C) 2013-2023 The git2r contributors 287s > ## 287s > ## This program is free software; you can redistribute it and/or modify 287s > ## it under the terms of the GNU General Public License, version 2, 287s > ## as published by the Free Software Foundation. 287s > ## 287s > ## git2r is distributed in the hope that it will be useful, 287s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 287s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 287s > ## GNU General Public License for more details. 287s > ## 287s > ## You should have received a copy of the GNU General Public License along 287s > ## with this program; if not, write to the Free Software Foundation, Inc., 287s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 287s > 287s > library("git2r") 287s > 287s > ## For debugging 287s > sessionInfo() 287s R version 4.4.3 (2025-02-28) 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s Running under: Ubuntu Plucky Puffin (development branch) 287s 287s Matrix products: default 287s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 287s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 287s 287s locale: 287s [1] C 287s 287s time zone: Etc/UTC 287s tzcode source: system (glibc) 287s 287s attached base packages: 287s [1] stats graphics grDevices utils datasets methods base 287s 287s other attached packages: 287s [1] git2r_0.35.0 287s 287s loaded via a namespace (and not attached): 287s [1] compiler_4.4.3 287s > libgit2_version() 287s $major 287s [1] 1 287s 287s $minor 287s [1] 9 287s 287s $rev 287s [1] 0 287s 287s > libgit2_features() 287s $threads 287s [1] TRUE 287s 287s $https 287s [1] TRUE 287s 287s $ssh 287s [1] TRUE 287s 287s > 287s > 287s > ## Create a directory in tempdir 287s > path <- tempfile(pattern = "git2r-") 287s > dir.create(path) 287s > 287s > ## Initialize a repository 287s > repo <- init(path) 287s > 287s > ## Config repository 287s > cfg <- config(repo, user.name = "Alice", user.email = "alice@example.org") 287s > 287s > ## Check configuration 287s > stopifnot(identical(print(cfg), cfg)) 287s local: 287s core.bare=false 287s core.filemode=true 287s core.logallrefupdates=true 287s core.repositoryformatversion=0 287s user.email=alice@example.org 287s user.name=Alice 287s > stopifnot("local" %in% names(cfg)) 287s > stopifnot("user.name" %in% names(cfg$local)) 287s > stopifnot(identical(cfg$local$user.name, "Alice")) 287s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 287s > 287s > ## Check that config fails for non-character entry. 287s > tools::assertError(config(repo, test = 5)) 287s > 287s > ## Check config method with missing repo argument 287s > wd <- setwd(path) 287s > cfg <- config(user.name = "Alice", user.email = "alice@example.org") 287s > stopifnot("local" %in% names(cfg)) 287s > stopifnot("user.name" %in% names(cfg$local)) 287s > stopifnot(identical(cfg$local$user.name, "Alice")) 287s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 287s > stopifnot(identical(git_config_files(repo = repo)$local, 287s + git_config_files(repo = NULL)$local)) 287s > stopifnot(identical(git_config_files(repo = repo)$local, 287s + git_config_files(repo = repo$path)$local)) 287s > if (!is.null(wd)) 287s + setwd(wd) 287s > 287s > ## Delete entries 287s > cfg <- config(repo, user.name = NULL, user.email = NULL) 287s > 287s > ## Check configuration 287s > stopifnot(is.null(cfg$local$user.name)) 287s > stopifnot(is.null(cfg$local$user.email)) 287s > 287s > ## Supply values as objects 287s > user_name <- "Alice" 287s > user_email <- "alice@example.org" 287s > cfg <- config(repo, user.name = user_name, user.email = "alice@example.org") 287s > stopifnot(identical(cfg$local$user.name, user_name)) 287s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 287s > cfg <- config(repo, user.name = "Alice", user.email = user_email) 287s > stopifnot(identical(cfg$local$user.name, "Alice")) 287s > stopifnot(identical(cfg$local$user.email, user_email)) 287s > 287s > ## Check git config files 287s > cfg <- git_config_files(repo) 287s > stopifnot(identical(nrow(cfg), 4L)) 287s > stopifnot(identical(names(cfg), c("file", "path"))) 287s > stopifnot(identical(cfg$file, c("system", "xdg", "global", "local"))) 287s > stopifnot(!is.na(cfg$path[4])) 287s > 287s > ## Check that the local config file is NA for an invalid repo 287s > ## argument. 287s > stopifnot(is.na(git_config_files(5)$local)) 287s > 287s > ## Check location of .gitconfig on Windows 287s > if (identical(Sys.getenv("APPVEYOR"), "True")) { 287s + 287s + ## AppVeyor diagnostics 287s + str(Sys.getenv("USERPROFILE")) 287s + str(Sys.getenv("HOMEDRIVE")) 287s + str(normalizePath("~")) 287s + str(git_config_files()) 287s + 287s + ## Temporarily move AppVeyor .gitconfig 287s + gitconfig_appveyor <- "C:/Users/appveyor/.gitconfig" 287s + gitconfig_tmp <- file.path(tempdir(), ".gitconfig") 287s + file.rename(gitconfig_appveyor, gitconfig_tmp) 287s + 287s + ## Test config() on Windows 287s + gitconfig_expected <- file.path(Sys.getenv("USERPROFILE"), ".gitconfig") 287s + ## .gitconfig should not be created if no configuration options specified 287s + config(global = TRUE) 287s + stopifnot(!file.exists(gitconfig_expected)) 287s + ## .gitconfig should be created in the user's home directory 287s + config(global = TRUE, user.name = "name", user.email = "email") 287s + stopifnot(file.exists(gitconfig_expected)) 287s + unlink(gitconfig_expected) 287s + ## .gitconfig should be created if user specifies option other than user.name 287s + ## and user.email 287s + config(global = TRUE, core.editor = "nano") 287s + stopifnot(file.exists(gitconfig_expected)) 287s + unlink(gitconfig_expected) 287s + ## .gitconfig should not create a new .gitconfig if the user already has one 287s + ## in Documents/ 287s + gitconfig_documents <- "~/.gitconfig" 287s + file.create(gitconfig_documents) 287s + config(global = TRUE, core.editor = "nano") 287s + stopifnot(!file.exists(gitconfig_expected)) 287s + unlink(gitconfig_documents) 287s + 287s + ## Return AppVeyor .gitconfig 287s + file.rename(gitconfig_tmp, gitconfig_appveyor) 287s + } 287s > 287s > ## Cleanup 287s > unlink(path, recursive = TRUE) 287s > 287s BEGIN TEST diff.R 287s 287s R version 4.4.3 (2025-02-28) -- "Trophy Case" 287s Copyright (C) 2025 The R Foundation for Statistical Computing 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s 287s R is free software and comes with ABSOLUTELY NO WARRANTY. 287s You are welcome to redistribute it under certain conditions. 287s Type 'license()' or 'licence()' for distribution details. 287s 287s R is a collaborative project with many contributors. 287s Type 'contributors()' for more information and 287s 'citation()' on how to cite R or R packages in publications. 287s 287s Type 'demo()' for some demos, 'help()' for on-line help, or 287s 'help.start()' for an HTML browser interface to help. 287s Type 'q()' to quit R. 287s 287s > ## git2r, R bindings to the libgit2 library. 287s > ## Copyright (C) 2013-2023 The git2r contributors 287s > ## 287s > ## This program is free software; you can redistribute it and/or modify 287s > ## it under the terms of the GNU General Public License, version 2, 287s > ## as published by the Free Software Foundation. 287s > ## 287s > ## git2r is distributed in the hope that it will be useful, 287s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 287s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 287s > ## GNU General Public License for more details. 287s > ## 287s > ## You should have received a copy of the GNU General Public License along 287s > ## with this program; if not, write to the Free Software Foundation, Inc., 287s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 287s > 287s > library("git2r") 287s > 287s > ## For debugging 287s > sessionInfo() 287s R version 4.4.3 (2025-02-28) 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s Running under: Ubuntu Plucky Puffin (development branch) 287s 287s Matrix products: default 287s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 287s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 287s 287s locale: 287s [1] C 287s 287s time zone: Etc/UTC 287s tzcode source: system (glibc) 287s 287s attached base packages: 287s [1] stats graphics grDevices utils datasets methods base 287s 287s other attached packages: 287s [1] git2r_0.35.0 287s 287s loaded via a namespace (and not attached): 287s [1] compiler_4.4.3 287s > libgit2_version() 287s $major 287s [1] 1 287s 287s $minor 287s [1] 9 287s 287s $rev 287s [1] 0 287s 287s > libgit2_features() 287s $threads 287s [1] TRUE 287s 287s $https 287s [1] TRUE 287s 287s $ssh 287s [1] TRUE 287s 287s > 287s > 287s > ## Create a directory in tempdir 287s > path <- tempfile(pattern = "git2r-") 287s > dir.create(path) 287s > 287s > ## Initialize a repository 287s > repo <- init(path) 287s > config(repo, user.name = "Alice", user.email = "alice@example.org") 287s > 287s > ## Create a file, add, commit 287s > writeLines("Hello world!", file.path(path, "test.txt")) 287s > add(repo, "test.txt") 287s > commit(repo, "Commit message") 287s [bd4882d] 2025-03-15: Commit message 287s > 287s > ## Change the file, diff between index and workdir 287s > writeLines("Hello again!\nHere is a second line\nAnd a third", 287s + file.path(path, "test.txt")) 287s > diff_1 <- diff(repo) 287s > diff(repo, as_char = TRUE) 287s [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" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_1$old, "index")) 287s > stopifnot(identical(diff_1$new, "workdir")) 287s > stopifnot(identical(length(diff_1$files), 1L)) 287s > stopifnot(identical(diff_1$files[[1]]$old_file, "test.txt")) 287s > stopifnot(identical(diff_1$files[[1]]$new_file, "test.txt")) 287s > stopifnot(identical(length(diff_1$files[[1]]$hunks), 1L)) 287s > stopifnot(identical(length(diff_1$files[[1]]$hunks[[1]]$lines), 4L)) 287s > ## TODO: check actual diff 287s > 287s > ## Diff between index and HEAD is empty 287s > diff_2 <- diff(repo, index = TRUE) 287s > diff(repo, as_char = TRUE) 287s [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" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_2$old, "HEAD")) 287s > stopifnot(identical(diff_2$new, "index")) 287s > stopifnot(identical(diff_2$files, list())) 287s > 287s > ## Diff between tree and working dir, same as diff_1 287s > diff_3 <- diff(tree(commits(repo)[[1]])) 287s > diff(repo, as_char = TRUE) 287s [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" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_3$old, tree(commits(repo)[[1]]))) 287s > stopifnot(identical(diff_3$new, "workdir")) 287s > stopifnot(identical(diff_3$files, diff_1$files)) 287s > stopifnot(identical(print(diff_3), diff_3)) 287s Old: tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 287s 287s mode type sha name 287s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 287s New: workdir 287s > 287s > ## Add changes, diff between index and HEAD is the same as diff_1 287s > add(repo, "test.txt") 287s > diff_4 <- diff(repo, index = TRUE) 287s > diff(repo, as_char = TRUE) 287s [1] "" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_4$old, "HEAD")) 287s > stopifnot(identical(diff_4$new, "index")) 287s > stopifnot(identical(diff_4$files, diff_1$files)) 287s > 287s > ## Diff between tree and index 287s > diff_5 <- diff(tree(commits(repo)[[1]]), index = TRUE) 287s > diff(repo, as_char = TRUE) 287s [1] "" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_5$old, tree(commits(repo)[[1]]))) 287s > stopifnot(identical(diff_5$new, "index")) 287s > stopifnot(identical(diff_5$files, diff_1$files)) 287s > 287s > ## Diff between two trees 287s > commit(repo, "Second commit") 287s [0e36874] 2025-03-15: Second commit 287s > tree_1 <- tree(commits(repo)[[2]]) 287s > tree_2 <- tree(commits(repo)[[1]]) 287s > diff_6 <- diff(tree_1, tree_2) 287s > diff(repo, as_char = TRUE) 287s [1] "" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(identical(diff_6$old, tree_1)) 287s > stopifnot(identical(diff_6$new, tree_2)) 287s > stopifnot(identical(diff_6$files, diff_1$files)) 287s > 287s > ## Length of a diff 287s > stopifnot(identical(length(diff_1), 1L)) 287s > stopifnot(identical(length(diff_2), 0L)) 287s > stopifnot(identical(length(diff_3), 1L)) 287s > stopifnot(identical(length(diff_4), 1L)) 287s > stopifnot(identical(length(diff_5), 1L)) 287s > stopifnot(identical(length(diff_6), 1L)) 287s > 287s > ## Binary files 287s > set.seed(42) 287s > writeBin(as.raw((sample(0:255, 1000, replace = TRUE))), 287s + con = file.path(path, "test.bin")) 287s > add(repo, "test.bin") 287s > diff_7 <- diff(repo, index = TRUE) 287s > diff(repo, as_char = TRUE) 287s [1] "" 287s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 287s NULL 287s > 287s > stopifnot(any(grepl("binary file", capture.output(summary(diff_7))))) 287s > 287s > ## TODO: errors 287s > ## Check non-logical index argument 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, NULL, NULL, NULL, "FALSE", 287s + NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep(paste0("Error in 'git2r_diff': 'index' must be logical ", 287s + "vector of length one with non NA value\n"), 287s + res[[1]]$message)) > 0) 287s > 287s > ## Check various combinations of diff arguments 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, NULL, NULL, 287s + tree(commits(repo)[[1]]), 287s + FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, NULL, NULL, 287s + tree(commits(repo)[[1]]), 287s + TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 287s + NULL, FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 287s + NULL, TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 287s + tree(commits(repo)[[2]]), FALSE, NULL, 3L, 0L, "a", 287s + "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > res <- tools::assertError( 287s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 287s + tree(commits(repo)[[2]]), TRUE, NULL, 3L, 0L, "a", 287s + "b", NULL, NULL, NULL)) 287s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 287s + res[[1]]$message)) > 0) 287s > 287s > ## TODO: printing 287s > 287s > ## Cleanup 287s > unlink(path, recursive = TRUE) 287s > 287s BEGIN TEST fast_forward_merge.R 287s 287s R version 4.4.3 (2025-02-28) -- "Trophy Case" 287s Copyright (C) 2025 The R Foundation for Statistical Computing 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s 287s R is free software and comes with ABSOLUTELY NO WARRANTY. 287s You are welcome to redistribute it under certain conditions. 287s Type 'license()' or 'licence()' for distribution details. 287s 287s R is a collaborative project with many contributors. 287s Type 'contributors()' for more information and 287s 'citation()' on how to cite R or R packages in publications. 287s 287s Type 'demo()' for some demos, 'help()' for on-line help, or 287s 'help.start()' for an HTML browser interface to help. 287s Type 'q()' to quit R. 287s 287s > ## git2r, R bindings to the libgit2 library. 287s > ## Copyright (C) 2013-2023 The git2r contributors 287s > ## 287s > ## This program is free software; you can redistribute it and/or modify 287s > ## it under the terms of the GNU General Public License, version 2, 287s > ## as published by the Free Software Foundation. 287s > ## 287s > ## git2r is distributed in the hope that it will be useful, 287s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 287s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 287s > ## GNU General Public License for more details. 287s > ## 287s > ## You should have received a copy of the GNU General Public License along 287s > ## with this program; if not, write to the Free Software Foundation, Inc., 287s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 287s > 287s > library(git2r) 287s > 287s > ## For debugging 287s > sessionInfo() 287s R version 4.4.3 (2025-02-28) 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s Running under: Ubuntu Plucky Puffin (development branch) 287s 287s Matrix products: default 287s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 287s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 287s 287s locale: 287s [1] C 287s 287s time zone: Etc/UTC 287s tzcode source: system (glibc) 287s 287s attached base packages: 287s [1] stats graphics grDevices utils datasets methods base 287s 287s other attached packages: 287s [1] git2r_0.35.0 287s 287s loaded via a namespace (and not attached): 287s [1] compiler_4.4.3 287s > libgit2_version() 287s $major 287s [1] 1 287s 287s $minor 287s [1] 9 287s 287s $rev 287s [1] 0 287s 287s > libgit2_features() 287s $threads 287s [1] TRUE 287s 287s $https 287s [1] TRUE 287s 287s $ssh 287s [1] TRUE 287s 287s > 287s > 287s > ## Create directory for repository in tempdir 287s > path <- tempfile(pattern = "git2r-") 287s > dir.create(path) 287s > 287s > ## Create repository 287s > repo <- init(path, branch = "main") 287s > config(repo, user.name = "Alice", user.email = "alice@example.org") 287s > 287s > ## Add changes to repo 287s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 287s + con = file.path(path, "test-1.txt")) 287s > add(repo, "test-1.txt") 287s > commit_1 <- commit(repo, "First commit message") 287s > 287s > ## Create branch and checkout 287s > checkout(branch_create(commit_1, name = "test")) 287s > 287s > ## Add changes to test branch 287s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 287s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 287s + con = file.path(path, "test-1.txt")) 287s > add(repo, "test-1.txt") 287s > commit_2 <- commit(repo, "Second commit message") 287s > 287s > # Checkout main and merge 287s > b <- branches(repo) 287s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 287s > m <- merge(b[sapply(b, "[", "name") == "test"][[1]]) 287s > 287s > # Check merge 287s > stopifnot(inherits(m, "git_merge_result")) 287s > stopifnot(identical(m$up_to_date, FALSE)) 287s > stopifnot(identical(m$fast_forward, TRUE)) 287s > stopifnot(identical(m$conflicts, FALSE)) 287s > stopifnot(identical(sha(m), NA_character_)) 287s > stopifnot(identical(length(commits(repo)), 2L)) 287s > 287s > # Check reflog 287s > r <- reflog(repo) 287s > stopifnot(identical(r[[1]]$message, "merge test: Fast-forward")) 287s > 287s > ## Cleanup 287s > unlink(path, recursive = TRUE) 287s > 287s BEGIN TEST fetch.R 287s 287s R version 4.4.3 (2025-02-28) -- "Trophy Case" 287s Copyright (C) 2025 The R Foundation for Statistical Computing 287s Platform: arm-unknown-linux-gnueabihf (32-bit) 287s 287s R is free software and comes with ABSOLUTELY NO WARRANTY. 287s You are welcome to redistribute it under certain conditions. 287s Type 'license()' or 'licence()' for distribution details. 287s 287s R is a collaborative project with many contributors. 287s Type 'contributors()' for more information and 287s 'citation()' on how to cite R or R packages in publications. 287s 287s Type 'demo()' for some demos, 'help()' for on-line help, or 287s 'help.start()' for an HTML browser interface to help. 287s Type 'q()' to quit R. 287s 288s > ## git2r, R bindings to the libgit2 library. 288s > ## Copyright (C) 2013-2023 The git2r contributors 288s > ## 288s > ## This program is free software; you can redistribute it and/or modify 288s > ## it under the terms of the GNU General Public License, version 2, 288s > ## as published by the Free Software Foundation. 288s > ## 288s > ## git2r is distributed in the hope that it will be useful, 288s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 288s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 288s > ## GNU General Public License for more details. 288s > ## 288s > ## You should have received a copy of the GNU General Public License along 288s > ## with this program; if not, write to the Free Software Foundation, Inc., 288s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 288s > 288s > library(git2r) 288s > 288s > ## For debugging 288s > sessionInfo() 288s R version 4.4.3 (2025-02-28) 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s Running under: Ubuntu Plucky Puffin (development branch) 288s 288s Matrix products: default 288s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 288s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 288s 288s locale: 288s [1] C 288s 288s time zone: Etc/UTC 288s tzcode source: system (glibc) 288s 288s attached base packages: 288s [1] stats graphics grDevices utils datasets methods base 288s 288s other attached packages: 288s [1] git2r_0.35.0 288s 288s loaded via a namespace (and not attached): 288s [1] compiler_4.4.3 288s > libgit2_version() 288s $major 288s [1] 1 288s 288s $minor 288s [1] 9 288s 288s $rev 288s [1] 0 288s 288s > libgit2_features() 288s $threads 288s [1] TRUE 288s 288s $https 288s [1] TRUE 288s 288s $ssh 288s [1] TRUE 288s 288s > 288s > 288s > ## Create 2 directories in tempdir 288s > path_bare <- tempfile(pattern = "git2r-") 288s > path_repo_1 <- tempfile(pattern = "git2r-") 288s > path_repo_2 <- tempfile(pattern = "git2r-") 288s > 288s > dir.create(path_bare) 288s > dir.create(path_repo_1) 288s > dir.create(path_repo_2) 288s > 288s > ## Create repositories 288s > bare_repo <- init(path_bare, bare = TRUE) 288s > repo_1 <- clone(path_bare, path_repo_1) 288s cloning into '/tmp/RtmptKdwRP/git2r-7cf2c605c2b'... 288s > repo_2 <- clone(path_bare, path_repo_2) 288s cloning into '/tmp/RtmptKdwRP/git2r-7cf3ebbc797'... 288s > 288s > ## Config repositories 288s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 288s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 288s > 288s > ## Add changes to repo 1 288s > writeLines("Hello world", con = file.path(path_repo_1, "test.txt")) 288s > add(repo_1, "test.txt") 288s > commit_1 <- commit(repo_1, "Commit message") 288s > branch_name <- branches(repo_1)[[1]]$name 288s > 288s > ## Push changes from repo 1 to origin 288s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 288s > 288s > ## Check result in bare repository 288s > stopifnot(identical(length(commits(bare_repo)), 1L)) 288s > bare_commit_1 <- commits(bare_repo)[[1]] 288s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 288s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 288s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 288s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 288s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 288s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 288s > 288s > ## Fetch 288s > fetch(repo_2, "origin") 288s [new] 721033386be8888a3ea9 refs/remotes/origin/master 288s > fh <- fetch_heads(repo_2)[[1]] 288s > stopifnot(identical(sha(fh), fh$sha)) 288s > 288s > ## Test show method of non-empty repository where head is null 288s > show(repo_2) 288s Local: /tmp/RtmptKdwRP/git2r-7cf3ebbc797 288s Head: nothing commited (yet) 288s > 288s > ## Check that 'git2r_arg_check_credentials' raise error 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", 288s + 3, "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", repo_1, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- cred_env(c("username", "username"), "password") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- cred_env("username", c("password", "passowrd")) 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- cred_user_pass(c("username", "username"), "password") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- cred_user_pass("username", c("password", "passowrd")) 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- cred_token(c("GITHUB_PAT", "GITHUB_PAT")) 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- structure(list(publickey = c("id_rsa.pub", "id_rsa.pub"), 288s + privatekey = "id_rsa", 288s + passphrase = character(0)), 288s + class = "cred_ssh_key") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- structure(list(publickey = "id_rsa.pub", 288s + privatekey = c("id_rsa", "id_rsa"), 288s + passphrase = character(0)), 288s + class = "cred_ssh_key") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- structure(list(publickey = "id_rsa.pub", 288s + privatekey = "id_rsa", 288s + passphrase = NA_character_), 288s + class = "cred_ssh_key") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > credentials <- structure(list(publickey = "id_rsa.pub", 288s + privatekey = "id_rsa", 288s + passphrase = c("passphrase", "passphrase")), 288s + class = "cred_ssh_key") 288s > res <- tools::assertError( 288s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 288s + "fetch", FALSE, NULL)) 288s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 288s + res[[1]]$message)) > 0) 288s > 288s > ## Cleanup 288s > unlink(path_bare, recursive = TRUE) 288s > unlink(path_repo_1, recursive = TRUE) 288s > unlink(path_repo_2, recursive = TRUE) 288s > 288s BEGIN TEST graph.R 288s 288s R version 4.4.3 (2025-02-28) -- "Trophy Case" 288s Copyright (C) 2025 The R Foundation for Statistical Computing 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s 288s R is free software and comes with ABSOLUTELY NO WARRANTY. 288s You are welcome to redistribute it under certain conditions. 288s Type 'license()' or 'licence()' for distribution details. 288s 288s R is a collaborative project with many contributors. 288s Type 'contributors()' for more information and 288s 'citation()' on how to cite R or R packages in publications. 288s 288s Type 'demo()' for some demos, 'help()' for on-line help, or 288s 'help.start()' for an HTML browser interface to help. 288s Type 'q()' to quit R. 288s 288s > ## git2r, R bindings to the libgit2 library. 288s > ## Copyright (C) 2013-2023 The git2r contributors 288s > ## 288s > ## This program is free software; you can redistribute it and/or modify 288s > ## it under the terms of the GNU General Public License, version 2, 288s > ## as published by the Free Software Foundation. 288s > ## 288s > ## git2r is distributed in the hope that it will be useful, 288s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 288s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 288s > ## GNU General Public License for more details. 288s > ## 288s > ## You should have received a copy of the GNU General Public License along 288s > ## with this program; if not, write to the Free Software Foundation, Inc., 288s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 288s > 288s > library("git2r") 288s > 288s > ## For debugging 288s > sessionInfo() 288s R version 4.4.3 (2025-02-28) 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s Running under: Ubuntu Plucky Puffin (development branch) 288s 288s Matrix products: default 288s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 288s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 288s 288s locale: 288s [1] C 288s 288s time zone: Etc/UTC 288s tzcode source: system (glibc) 288s 288s attached base packages: 288s [1] stats graphics grDevices utils datasets methods base 288s 288s other attached packages: 288s [1] git2r_0.35.0 288s 288s loaded via a namespace (and not attached): 288s [1] compiler_4.4.3 288s > libgit2_version() 288s $major 288s [1] 1 288s 288s $minor 288s [1] 9 288s 288s $rev 288s [1] 0 288s 288s > libgit2_features() 288s $threads 288s [1] TRUE 288s 288s $https 288s [1] TRUE 288s 288s $ssh 288s [1] TRUE 288s 288s > 288s > 288s > ## Create a directory in tempdir 288s > path <- tempfile(pattern = "git2r-") 288s > dir.create(path) 288s > 288s > ## Initialize a repository 288s > repo <- init(path) 288s > config(repo, user.name = "Alice", user.email = "alice@example.org") 288s > 288s > ## Create a file and commit 288s > writeLines("Hello world!", file.path(path, "test.txt")) 288s > add(repo, "test.txt") 288s > commit_1 <- commit(repo, "First commit message") 288s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 288s > 288s > ## Change file and commit 288s > writeLines(c("Hello world!", "HELLO WORLD!"), 288s + file.path(path, "test.txt")) 288s > add(repo, "test.txt") 288s > commit_2 <- commit(repo, "Second commit message") 288s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 288s > 288s > ## Check ahead behind 288s > stopifnot(identical(ahead_behind(commit_1, commit_2), c(0L, 1L))) 288s > stopifnot(identical(ahead_behind(tag_1, tag_2), c(0L, 1L))) 288s > stopifnot(identical(ahead_behind(tag_2, tag_1), c(1L, 0L))) 288s > stopifnot(identical(ahead_behind(commit_1, branches(repo)[[1]]), c(0L, 1L))) 288s > stopifnot(identical(ahead_behind(branches(repo)[[1]], commit_1), c(1L, 0L))) 288s > 288s > ## Cleanup 288s > unlink(path, recursive = TRUE) 288s > 288s BEGIN TEST index.R 288s 288s R version 4.4.3 (2025-02-28) -- "Trophy Case" 288s Copyright (C) 2025 The R Foundation for Statistical Computing 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s 288s R is free software and comes with ABSOLUTELY NO WARRANTY. 288s You are welcome to redistribute it under certain conditions. 288s Type 'license()' or 'licence()' for distribution details. 288s 288s R is a collaborative project with many contributors. 288s Type 'contributors()' for more information and 288s 'citation()' on how to cite R or R packages in publications. 288s 288s Type 'demo()' for some demos, 'help()' for on-line help, or 288s 'help.start()' for an HTML browser interface to help. 288s Type 'q()' to quit R. 288s 288s > ## git2r, R bindings to the libgit2 library. 288s > ## Copyright (C) 2013-2023 The git2r contributors 288s > ## 288s > ## This program is free software; you can redistribute it and/or modify 288s > ## it under the terms of the GNU General Public License, version 2, 288s > ## as published by the Free Software Foundation. 288s > ## 288s > ## git2r is distributed in the hope that it will be useful, 288s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 288s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 288s > ## GNU General Public License for more details. 288s > ## 288s > ## You should have received a copy of the GNU General Public License along 288s > ## with this program; if not, write to the Free Software Foundation, Inc., 288s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 288s > 288s > library(git2r) 288s > source("util/check.R") 288s > 288s > ## For debugging 288s > sessionInfo() 288s R version 4.4.3 (2025-02-28) 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s Running under: Ubuntu Plucky Puffin (development branch) 288s 288s Matrix products: default 288s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 288s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 288s 288s locale: 288s [1] C 288s 288s time zone: Etc/UTC 288s tzcode source: system (glibc) 288s 288s attached base packages: 288s [1] stats graphics grDevices utils datasets methods base 288s 288s other attached packages: 288s [1] git2r_0.35.0 288s 288s loaded via a namespace (and not attached): 288s [1] compiler_4.4.3 288s > libgit2_version() 288s $major 288s [1] 1 288s 288s $minor 288s [1] 9 288s 288s $rev 288s [1] 0 288s 288s > libgit2_features() 288s $threads 288s [1] TRUE 288s 288s $https 288s [1] TRUE 288s 288s $ssh 288s [1] TRUE 288s 288s > 288s > 288s > ## Create a directory in tempdir 288s > path <- tempfile(pattern = "git2r-") 288s > dir.create(path) 288s > 288s > ## Initialize a repository 288s > repo <- init(path) 288s > config(repo, user.name = "Alice", user.email = "alice@example.org") 288s > 288s > ## Create directories 288s > dir.create(file.path(path, "sub-folder")); 288s > dir.create(file.path(path, "sub-folder", "sub-sub-folder")); 288s > 288s > ## Create files 288s > writeLines("Hello world!", 288s + file.path(path, "file-1.txt")) 288s > writeLines("Hello world!", 288s + file.path(path, "sub-folder", "file-2.txt")) 288s > writeLines("Hello world!", 288s + file.path(path, "sub-folder", "file-3.txt")) 288s > writeLines("Hello world!", 288s + file.path(path, "sub-folder", "sub-sub-folder", "file-4.txt")) 288s > writeLines("Hello world!", 288s + file.path(path, "sub-folder", "sub-sub-folder", "file-5.txt")) 288s > 288s > ## Add 288s > add(repo, "file-1.txt") 288s > status_exp <- structure(list(staged = list(new = "file-1.txt"), 288s + unstaged = empty_named_list(), 288s + untracked = list(untracked = "sub-folder/")), 288s + class = "git_status") 288s > status_obs <- status(repo) 288s > stopifnot(identical(status_obs, status_exp)) 288s > 288s > ## Index remove by path 288s > index_remove_bypath(repo, "file-1.txt") 288s > status_exp <- structure(list(staged = empty_named_list(), 288s + unstaged = empty_named_list(), 288s + untracked = list(untracked = "file-1.txt", 288s + untracked = "sub-folder/")), 288s + class = "git_status") 288s > status_obs <- status(repo) 288s > stopifnot(identical(status_obs, status_exp)) 288s > 288s > ## Add 288s > add(repo, "sub-folder") 288s > status_exp <- structure(list(staged = list( 288s + new = "sub-folder/file-2.txt", 288s + new = "sub-folder/file-3.txt", 288s + new = "sub-folder/sub-sub-folder/file-4.txt", 288s + new = "sub-folder/sub-sub-folder/file-5.txt"), 288s + unstaged = empty_named_list(), 288s + untracked = list(untracked = "file-1.txt")), 288s + class = "git_status") 288s > status_obs <- status(repo) 288s > stopifnot(identical(status_obs, status_exp)) 288s > 288s > ## Commit 288s > commit(repo, "First commit message") 288s [90d1c55] 2025-03-15: First commit message 288s > 288s > ## It should fail to remove non-existing, untracked and ignored files 288s > tools::assertError(rm_file(repo, c("file-1.txt", "file-2.txt"))) 288s > tools::assertError(rm_file(repo, c("file-1.txt", ""))) 288s > tools::assertError(rm_file(repo, c("file-1.txt"))) 288s > writeLines("/file-1.txt", file.path(path, ".gitignore")) 288s > tools::assertError(rm_file(repo, "file-1.txt")) 288s > 288s > ## It should fail to remove files with staged changes 288s > file.remove(file.path(path, ".gitignore")) 288s [1] TRUE 288s > add(repo, "file-1.txt") 288s > tools::assertError(rm_file(repo, "file-1.txt")) 288s > 288s > ## It should fail to remove files with unstaged changes 288s > commit(repo, "Second commit message") 288s [9c12d39] 2025-03-15: Second commit message 288s > writeLines(c("Hello world!", "Hello world!"), 288s + file.path(path, "file-1.txt")) 288s > tools::assertError(rm_file(repo, "file-1.txt")) 288s > 288s > ## Remove file 288s > add(repo, "file-1.txt") 288s > commit(repo, "Third commit message") 288s [31afafb] 2025-03-15: Third commit message 288s > rm_file(repo, "file-1.txt") 288s > status_exp <- structure(list(staged = list(deleted = "file-1.txt"), 288s + unstaged = empty_named_list(), 288s + untracked = empty_named_list()), 288s + class = "git_status") 288s > status_obs <- status(repo) 288s > stopifnot(identical(status_obs, status_exp)) 288s > 288s > ## Cleanup 288s > unlink(path, recursive = TRUE) 288s > 288s BEGIN TEST invalid-conf-var.R 288s 288s R version 4.4.3 (2025-02-28) -- "Trophy Case" 288s Copyright (C) 2025 The R Foundation for Statistical Computing 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s 288s R is free software and comes with ABSOLUTELY NO WARRANTY. 288s You are welcome to redistribute it under certain conditions. 288s Type 'license()' or 'licence()' for distribution details. 288s 288s R is a collaborative project with many contributors. 288s Type 'contributors()' for more information and 288s 'citation()' on how to cite R or R packages in publications. 288s 288s Type 'demo()' for some demos, 'help()' for on-line help, or 288s 'help.start()' for an HTML browser interface to help. 288s Type 'q()' to quit R. 288s 288s > ## git2r, R bindings to the libgit2 library. 288s > ## Copyright (C) 2013-2023 The git2r contributors 288s > ## 288s > ## This program is free software; you can redistribute it and/or modify 288s > ## it under the terms of the GNU General Public License, version 2, 288s > ## as published by the Free Software Foundation. 288s > ## 288s > ## git2r is distributed in the hope that it will be useful, 288s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 288s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 288s > ## GNU General Public License for more details. 288s > ## 288s > ## You should have received a copy of the GNU General Public License along 288s > ## with this program; if not, write to the Free Software Foundation, Inc., 288s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 288s > 288s > library("git2r") 288s > 288s > ## For debugging 288s > sessionInfo() 288s R version 4.4.3 (2025-02-28) 288s Platform: arm-unknown-linux-gnueabihf (32-bit) 288s Running under: Ubuntu Plucky Puffin (development branch) 288s 288s Matrix products: default 288s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 288s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 288s 288s locale: 288s [1] C 288s 288s time zone: Etc/UTC 288s tzcode source: system (glibc) 288s 288s attached base packages: 288s [1] stats graphics grDevices utils datasets methods base 288s 288s other attached packages: 288s [1] git2r_0.35.0 288s 288s loaded via a namespace (and not attached): 288s [1] compiler_4.4.3 288s > libgit2_version() 288s $major 288s [1] 1 288s 288s $minor 288s [1] 9 288s 288s $rev 288s [1] 0 288s 288s > libgit2_features() 288s $threads 288s [1] TRUE 288s 288s $https 288s [1] TRUE 288s 288s $ssh 288s [1] TRUE 288s 288s > 288s > 288s > ## Create a directory in tempdir 288s > path <- tempfile(pattern = "git2r-") 288s > dir.create(path) 289s > 289s > ## Initialize a repository 289s > repo <- init(path) 289s > 289s > ## Config repository 289s > config(repo, user.name = "Alice") 289s > 289s > ## Let's set one valid and one with variable with invalid format 289s > res <- tools::assertWarning(config(repo, 289s + user.email = "alice@example.org", 289s + lol = "wut")) 289s > stopifnot(length(grep("Variable was not in a valid format: 'lol'", 289s + res[[1]]$message)) > 0) 289s > 289s > cfg_exp <- structure(list(user.name = "Alice", 289s + user.email = "alice@example.org", 289s + "NA" = NULL), 289s + .Names = c("user.name", "user.email", NA)) 289s > 289s > cfg_obs <- config(repo)$local 289s > cfg_obs <- cfg_obs[c("user.name", "user.email", "lol")] 289s > stopifnot(identical(cfg_obs, cfg_exp)) 289s > 289s > ## Cleanup 289s > unlink(path, recursive = TRUE) 289s > 289s BEGIN TEST libgit2.R 289s 289s R version 4.4.3 (2025-02-28) -- "Trophy Case" 289s Copyright (C) 2025 The R Foundation for Statistical Computing 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s 289s R is free software and comes with ABSOLUTELY NO WARRANTY. 289s You are welcome to redistribute it under certain conditions. 289s Type 'license()' or 'licence()' for distribution details. 289s 289s R is a collaborative project with many contributors. 289s Type 'contributors()' for more information and 289s 'citation()' on how to cite R or R packages in publications. 289s 289s Type 'demo()' for some demos, 'help()' for on-line help, or 289s 'help.start()' for an HTML browser interface to help. 289s Type 'q()' to quit R. 289s 289s > ## git2r, R bindings to the libgit2 library. 289s > ## Copyright (C) 2013-2023 The git2r contributors 289s > ## 289s > ## This program is free software; you can redistribute it and/or modify 289s > ## it under the terms of the GNU General Public License, version 2, 289s > ## as published by the Free Software Foundation. 289s > ## 289s > ## git2r is distributed in the hope that it will be useful, 289s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 289s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289s > ## GNU General Public License for more details. 289s > ## 289s > ## You should have received a copy of the GNU General Public License along 289s > ## with this program; if not, write to the Free Software Foundation, Inc., 289s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 289s > 289s > library("git2r") 289s > 289s > ## For debugging 289s > sessionInfo() 289s R version 4.4.3 (2025-02-28) 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s Running under: Ubuntu Plucky Puffin (development branch) 289s 289s Matrix products: default 289s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 289s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 289s 289s locale: 289s [1] C 289s 289s time zone: Etc/UTC 289s tzcode source: system (glibc) 289s 289s attached base packages: 289s [1] stats graphics grDevices utils datasets methods base 289s 289s other attached packages: 289s [1] git2r_0.35.0 289s 289s loaded via a namespace (and not attached): 289s [1] compiler_4.4.3 289s > libgit2_version() 289s $major 289s [1] 1 289s 289s $minor 289s [1] 9 289s 289s $rev 289s [1] 0 289s 289s > libgit2_features() 289s $threads 289s [1] TRUE 289s 289s $https 289s [1] TRUE 289s 289s $ssh 289s [1] TRUE 289s 289s > 289s > 289s > stopifnot(identical(names(libgit2_features()), 289s + c("threads", "https", "ssh"))) 289s > 289s > stopifnot(identical(names(libgit2_version()), 289s + c("major", "minor", "rev"))) 289s > 289s > tools::assertError(ssl_cert_locations()) 289s > 289s > if (identical(Sys.getenv("R_COVR"), "true")) { 289s + if (isTRUE(libgit2_features()$https)) { 289s + ## Create a directory in tempdir 289s + path <- tempfile(pattern = "git2r-") 289s + dir.create(path) 289s + stopifnot(is.null(ssl_cert_locations(path = path))) 289s + unlink(path) 289s + } 289s + } 289s > 289s BEGIN TEST ls_tree.R 289s 289s R version 4.4.3 (2025-02-28) -- "Trophy Case" 289s Copyright (C) 2025 The R Foundation for Statistical Computing 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s 289s R is free software and comes with ABSOLUTELY NO WARRANTY. 289s You are welcome to redistribute it under certain conditions. 289s Type 'license()' or 'licence()' for distribution details. 289s 289s R is a collaborative project with many contributors. 289s Type 'contributors()' for more information and 289s 'citation()' on how to cite R or R packages in publications. 289s 289s Type 'demo()' for some demos, 'help()' for on-line help, or 289s 'help.start()' for an HTML browser interface to help. 289s Type 'q()' to quit R. 289s 289s > ## git2r, R bindings to the libgit2 library. 289s > ## Copyright (C) 2013-2023 The git2r contributors 289s > ## 289s > ## This program is free software; you can redistribute it and/or modify 289s > ## it under the terms of the GNU General Public License, version 2, 289s > ## as published by the Free Software Foundation. 289s > ## 289s > ## git2r is distributed in the hope that it will be useful, 289s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 289s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289s > ## GNU General Public License for more details. 289s > ## 289s > ## You should have received a copy of the GNU General Public License along 289s > ## with this program; if not, write to the Free Software Foundation, Inc., 289s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 289s > 289s > library("git2r") 289s > 289s > ## For debugging 289s > sessionInfo() 289s R version 4.4.3 (2025-02-28) 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s Running under: Ubuntu Plucky Puffin (development branch) 289s 289s Matrix products: default 289s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 289s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 289s 289s locale: 289s [1] C 289s 289s time zone: Etc/UTC 289s tzcode source: system (glibc) 289s 289s attached base packages: 289s [1] stats graphics grDevices utils datasets methods base 289s 289s other attached packages: 289s [1] git2r_0.35.0 289s 289s loaded via a namespace (and not attached): 289s [1] compiler_4.4.3 289s > libgit2_version() 289s $major 289s [1] 1 289s 289s $minor 289s [1] 9 289s 289s $rev 289s [1] 0 289s 289s > libgit2_features() 289s $threads 289s [1] TRUE 289s 289s $https 289s [1] TRUE 289s 289s $ssh 289s [1] TRUE 289s 289s > 289s > 289s > ## Initialize a temporary repository 289s > path <- tempfile(pattern = "git2r-") 289s > dir.create(path) 289s > dir.create(file.path(path, "subfolder")) 289s > repo <- init(path) 289s > 289s > ## Create a user 289s > config(repo, user.name = "Alice", user.email = "alice@example.org") 289s > 289s > ## Create three files and commit 289s > writeLines("First file", file.path(path, "example-1.txt")) 289s > writeLines("Second file", file.path(path, "subfolder/example-2.txt")) 289s > writeLines("Third file", file.path(path, "example-3.txt")) 289s > add(repo, c("example-1.txt", "subfolder/example-2.txt", "example-3.txt")) 289s > commit(repo, "Commit message") 289s [ca2e1b7] 2025-03-15: Commit message 289s > 289s > ## Traverse tree entries and its subtrees. 289s > ## Various approaches that give identical result. 289s > stopifnot(identical(ls_tree(tree = tree(last_commit(path))), 289s + ls_tree(tree = tree(last_commit(repo))))) 289s > stopifnot(identical(ls_tree(repo = path), ls_tree(repo = repo))) 289s > 289s > ## ls_tree(repo = repo) should match `git ls-tree -lr HEAD` 289s > ls_tree_result <- ls_tree(repo = repo) 289s > stopifnot(identical(ls_tree_result$name, 289s + c("example-1.txt", "example-3.txt", "example-2.txt"))) 289s > 289s > # Argument `tree` can be a 'character that identifies a tree in the repository' 289s > ls_tree(tree = tree(last_commit(path))$sha, repo = repo) 289s mode type sha path name 289s 1 100644 blob 4c5fd919d52e3c1b08f7924cfa05d6de100912fd example-1.txt 289s 2 100644 blob f89598da398eb016c504a5e272cb3eb1a31e2687 example-3.txt 289s 3 100644 blob 20d5b672a347112783818b3fc8cc7cd66ade3008 subfolder/ example-2.txt 289s len 289s 1 11 289s 2 11 289s 3 12 289s > 289s > ## Skip content in subfolder 289s > ls_tree_toplevel <- ls_tree(repo = repo, recursive = FALSE) 289s > stopifnot(nrow(ls_tree_toplevel) == 3) 289s > stopifnot(identical(ls_tree_toplevel$name, 289s + c("example-1.txt", "example-3.txt", "subfolder"))) 289s > 289s > ## Start in subfolder 289s > ls_tree_subfolder <- ls_tree(tree = "HEAD:subfolder", repo = repo) 289s > stopifnot(nrow(ls_tree_subfolder) == 1) 289s > stopifnot(identical(ls_tree_subfolder$name, "example-2.txt")) 289s > 289s > ## Cleanup 289s > unlink(path, recursive = TRUE) 289s > 289s BEGIN TEST merge.R 289s 289s R version 4.4.3 (2025-02-28) -- "Trophy Case" 289s Copyright (C) 2025 The R Foundation for Statistical Computing 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s 289s R is free software and comes with ABSOLUTELY NO WARRANTY. 289s You are welcome to redistribute it under certain conditions. 289s Type 'license()' or 'licence()' for distribution details. 289s 289s R is a collaborative project with many contributors. 289s Type 'contributors()' for more information and 289s 'citation()' on how to cite R or R packages in publications. 289s 289s Type 'demo()' for some demos, 'help()' for on-line help, or 289s 'help.start()' for an HTML browser interface to help. 289s Type 'q()' to quit R. 289s 289s > ## git2r, R bindings to the libgit2 library. 289s > ## Copyright (C) 2013-2023 The git2r contributors 289s > ## 289s > ## This program is free software; you can redistribute it and/or modify 289s > ## it under the terms of the GNU General Public License, version 2, 289s > ## as published by the Free Software Foundation. 289s > ## 289s > ## git2r is distributed in the hope that it will be useful, 289s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 289s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289s > ## GNU General Public License for more details. 289s > ## 289s > ## You should have received a copy of the GNU General Public License along 289s > ## with this program; if not, write to the Free Software Foundation, Inc., 289s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 289s > 289s > library(git2r) 289s > source("util/check.R") 289s > 289s > ## For debugging 289s > sessionInfo() 289s R version 4.4.3 (2025-02-28) 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s Running under: Ubuntu Plucky Puffin (development branch) 289s 289s Matrix products: default 289s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 289s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 289s 289s locale: 289s [1] C 289s 289s time zone: Etc/UTC 289s tzcode source: system (glibc) 289s 289s attached base packages: 289s [1] stats graphics grDevices utils datasets methods base 289s 289s other attached packages: 289s [1] git2r_0.35.0 289s 289s loaded via a namespace (and not attached): 289s [1] compiler_4.4.3 289s > libgit2_version() 289s $major 289s [1] 1 289s 289s $minor 289s [1] 9 289s 289s $rev 289s [1] 0 289s 289s > libgit2_features() 289s $threads 289s [1] TRUE 289s 289s $https 289s [1] TRUE 289s 289s $ssh 289s [1] TRUE 289s 289s > 289s > 289s > ## Create a directory in tempdir 289s > path <- tempfile(pattern = "git2r-") 289s > dir.create(path) 289s > 289s > ## Initialize a repository 289s > repo <- init(path, branch = "main") 289s > config(repo, user.name = "Alice", user.email = "alice@example.org") 289s > 289s > ## Create a file, add and commit 289s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 289s + con = file.path(path, "test.txt")) 289s > add(repo, "test.txt") 289s > commit_1 <- commit(repo, "Commit message 1") 289s > 289s > ## Create first branch, checkout, add file and commit 289s > b_1 <- branch_create(commit_1, "branch1") 289s > checkout(b_1) 289s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 289s > add(repo, "branch-1.txt") 289s > commit_2 <- commit(repo, "Commit message branch 1") 289s > 289s > ## Create second branch, checkout, add file and commit 289s > b_2 <- branch_create(commit_1, "branch2") 289s > checkout(b_2) 289s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 289s > add(repo, "branch-2.txt") 289s > commit_3 <- commit(repo, "Commit message branch 2") 289s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 289s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 289s + con = file.path(path, "test.txt")) 289s > add(repo, "test.txt") 289s > commit_4 <- commit(repo, "Second commit message branch 2") 289s > 289s > ## Check that merge base equals commit_1 289s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 289s > 289s > ## Checkout main 289s > b <- branches(repo) 289s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 289s > 289s > ## Merge branch 1 289s > m_1 <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 289s > stopifnot(identical(m_1$fast_forward, TRUE)) 289s > stopifnot(identical(m_1$conflicts, FALSE)) 289s > stopifnot(identical(sha(m_1), NA_character_)) 289s > stopifnot(identical(print(m_1), m_1)) 289s Merge: Fast-forward 289s > 289s > ## Merge branch 1 again 289s > m_1_again <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 289s > stopifnot(identical(m_1_again$up_to_date, TRUE)) 289s > stopifnot(identical(m_1_again$fast_forward, FALSE)) 289s > stopifnot(identical(m_1_again$conflicts, FALSE)) 289s > stopifnot(identical(sha(m_1_again), NA_character_)) 289s > 289s > ## Merge branch 2 289s > m_2 <- merge(b[sapply(b, "[", "name") == "branch2"][[1]]) 289s > stopifnot(identical(m_2$fast_forward, FALSE)) 289s > stopifnot(identical(m_2$conflicts, FALSE)) 289s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 289s > 289s > ## Create third branch, checkout, change file and commit 289s > b_3 <- branch_create(lookup(repo, sha(m_2)), "branch3") 289s > checkout(b_3) 289s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 289s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 289s + con = file.path(path, "test.txt")) 289s > add(repo, "test.txt") 289s > commit(repo, "Commit message branch 3") 289s [efe7b2e] 2025-03-15: Commit message branch 3 289s > 289s > ## Checkout main and create a change that creates a conflict on 289s > ## merge 289s > b <- branches(repo) 289s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 289s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 289s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 289s + con = file.path(path, "test.txt")) 289s > add(repo, "test.txt") 289s > commit(repo, "Some commit message branch 1") 289s [513f1ce] 2025-03-15: Some commit message branch 1 289s > 289s > ## Merge branch 3 with fail = TRUE 289s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]], fail = TRUE) 289s > stopifnot(identical(m_3$up_to_date, FALSE)) 289s > stopifnot(identical(m_3$fast_forward, FALSE)) 289s > stopifnot(identical(m_3$conflicts, TRUE)) 289s > stopifnot(identical(sha(m_3), NA_character_)) 289s > m_3 289s Merge: Conflicts 289s > 289s > ## Check status; Expect to have a clean working directory 289s > wd <- structure(list(staged = empty_named_list(), 289s + unstaged = empty_named_list(), 289s + untracked = empty_named_list()), 289s + class = "git_status") 289s > stopifnot(identical(status(repo), wd)) 289s > 289s > ## Merge branch 3 289s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]]) 289s > stopifnot(identical(m_3$up_to_date, FALSE)) 289s > stopifnot(identical(m_3$fast_forward, FALSE)) 289s > stopifnot(identical(m_3$conflicts, TRUE)) 289s > stopifnot(identical(sha(m_3), NA_character_)) 289s > m_3 289s Merge: Conflicts 289s > 289s > ## Check status; Expect to have one unstaged unmerged conflict. 289s > stopifnot(identical(status(repo), 289s + structure(list(staged = empty_named_list(), 289s + unstaged = list(conflicted = "test.txt"), 289s + untracked = empty_named_list()), 289s + class = "git_status"))) 289s > 289s > ## Cleanup 289s > unlink(path, recursive = TRUE) 289s > 289s BEGIN TEST merge_named_branch.R 289s 289s R version 4.4.3 (2025-02-28) -- "Trophy Case" 289s Copyright (C) 2025 The R Foundation for Statistical Computing 289s Platform: arm-unknown-linux-gnueabihf (32-bit) 289s 289s R is free software and comes with ABSOLUTELY NO WARRANTY. 289s You are welcome to redistribute it under certain conditions. 289s Type 'license()' or 'licence()' for distribution details. 289s 289s R is a collaborative project with many contributors. 289s Type 'contributors()' for more information and 289s 'citation()' on how to cite R or R packages in publications. 289s 289s Type 'demo()' for some demos, 'help()' for on-line help, or 289s 'help.start()' for an HTML browser interface to help. 289s Type 'q()' to quit R. 289s 290s > ## git2r, R bindings to the libgit2 library. 290s > ## Copyright (C) 2013-2023 The git2r contributors 290s > ## 290s > ## This program is free software; you can redistribute it and/or modify 290s > ## it under the terms of the GNU General Public License, version 2, 290s > ## as published by the Free Software Foundation. 290s > ## 290s > ## git2r is distributed in the hope that it will be useful, 290s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 290s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 290s > ## GNU General Public License for more details. 290s > ## 290s > ## You should have received a copy of the GNU General Public License along 290s > ## with this program; if not, write to the Free Software Foundation, Inc., 290s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 290s > 290s > library(git2r) 290s > source("util/check.R") 290s > 290s > ## For debugging 290s > sessionInfo() 290s R version 4.4.3 (2025-02-28) 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s Running under: Ubuntu Plucky Puffin (development branch) 290s 290s Matrix products: default 290s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 290s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 290s 290s locale: 290s [1] C 290s 290s time zone: Etc/UTC 290s tzcode source: system (glibc) 290s 290s attached base packages: 290s [1] stats graphics grDevices utils datasets methods base 290s 290s other attached packages: 290s [1] git2r_0.35.0 290s 290s loaded via a namespace (and not attached): 290s [1] compiler_4.4.3 290s > libgit2_version() 290s $major 290s [1] 1 290s 290s $minor 290s [1] 9 290s 290s $rev 290s [1] 0 290s 290s > libgit2_features() 290s $threads 290s [1] TRUE 290s 290s $https 290s [1] TRUE 290s 290s $ssh 290s [1] TRUE 290s 290s > 290s > 290s > ## Create a directory in tempdir 290s > path <- tempfile(pattern = "git2r-") 290s > dir.create(path) 290s > 290s > ## Initialize a repository 290s > repo <- init(path, branch = "main") 290s > config(repo, user.name = "Alice", user.email = "alice@example.org") 290s > 290s > ## Create a file, add and commit 290s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 290s + con = file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit_1 <- commit(repo, "Commit message 1") 290s > 290s > ## Create first branch, checkout, add file and commit 290s > checkout(repo, "branch1", create = TRUE) 290s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 290s > add(repo, "branch-1.txt") 290s > commit_2 <- commit(repo, "Commit message branch 1") 290s > 290s > ## Create second branch, checkout, add file and commit 290s > b_2 <- branch_create(commit_1, "branch2") 290s > checkout(b_2) 290s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 290s > add(repo, "branch-2.txt") 290s > commit_3 <- commit(repo, "Commit message branch 2") 290s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 290s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 290s + con = file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit_4 <- commit(repo, "Second commit message branch 2") 290s > 290s > ## Check that merge base equals commit_1 290s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 290s > 290s > ## Checkout main 290s > b <- branches(repo) 290s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 290s > 290s > ## Merge branch 1 290s > m_1 <- merge(repo, "branch1") 290s > stopifnot(identical(m_1$fast_forward, TRUE)) 290s > stopifnot(identical(m_1$conflicts, FALSE)) 290s > stopifnot(identical(sha(m_1), NA_character_)) 290s > 290s > ## Merge branch 2 290s > m_2 <- merge(path, "branch2") 290s > stopifnot(identical(m_2$fast_forward, FALSE)) 290s > stopifnot(identical(m_2$conflicts, FALSE)) 290s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 290s > 290s > ## Create third branch, checkout, change file and commit 290s > checkout(repo, "branch3", create = TRUE) 290s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 290s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 290s + con = file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit(repo, "Commit message branch 3") 290s [6701d31] 2025-03-15: Commit message branch 3 290s > 290s > ## Checkout main and create a change that creates a merge conflict 290s > checkout(repo, "main", force = TRUE) 290s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 290s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 290s + con = file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit(repo, "Some commit message branch 1") 290s [bdb83a0] 2025-03-15: Some commit message branch 1 290s > 290s > ## Merge branch 3 290s > m_3 <- merge(repo, "branch3") 290s > stopifnot(identical(m_3$up_to_date, FALSE)) 290s > stopifnot(identical(m_3$fast_forward, FALSE)) 290s > stopifnot(identical(m_3$conflicts, TRUE)) 290s > stopifnot(identical(sha(m_3), NA_character_)) 290s > 290s > ## Check status; Expect to have one unstaged unmerged conflict. 290s > stopifnot(identical(status(repo), 290s + structure(list(staged = empty_named_list(), 290s + unstaged = list(conflicted = "test.txt"), 290s + untracked = empty_named_list()), 290s + class = "git_status"))) 290s > 290s > ## Cleanup 290s > unlink(path, recursive = TRUE) 290s > 290s BEGIN TEST normal_merge.R 290s 290s R version 4.4.3 (2025-02-28) -- "Trophy Case" 290s Copyright (C) 2025 The R Foundation for Statistical Computing 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s 290s R is free software and comes with ABSOLUTELY NO WARRANTY. 290s You are welcome to redistribute it under certain conditions. 290s Type 'license()' or 'licence()' for distribution details. 290s 290s R is a collaborative project with many contributors. 290s Type 'contributors()' for more information and 290s 'citation()' on how to cite R or R packages in publications. 290s 290s Type 'demo()' for some demos, 'help()' for on-line help, or 290s 'help.start()' for an HTML browser interface to help. 290s Type 'q()' to quit R. 290s 290s > ## git2r, R bindings to the libgit2 library. 290s > ## Copyright (C) 2013-2023 The git2r contributors 290s > ## 290s > ## This program is free software; you can redistribute it and/or modify 290s > ## it under the terms of the GNU General Public License, version 2, 290s > ## as published by the Free Software Foundation. 290s > ## 290s > ## git2r is distributed in the hope that it will be useful, 290s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 290s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 290s > ## GNU General Public License for more details. 290s > ## 290s > ## You should have received a copy of the GNU General Public License along 290s > ## with this program; if not, write to the Free Software Foundation, Inc., 290s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 290s > 290s > library(git2r) 290s > 290s > ## For debugging 290s > sessionInfo() 290s R version 4.4.3 (2025-02-28) 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s Running under: Ubuntu Plucky Puffin (development branch) 290s 290s Matrix products: default 290s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 290s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 290s 290s locale: 290s [1] C 290s 290s time zone: Etc/UTC 290s tzcode source: system (glibc) 290s 290s attached base packages: 290s [1] stats graphics grDevices utils datasets methods base 290s 290s other attached packages: 290s [1] git2r_0.35.0 290s 290s loaded via a namespace (and not attached): 290s [1] compiler_4.4.3 290s > libgit2_version() 290s $major 290s [1] 1 290s 290s $minor 290s [1] 9 290s 290s $rev 290s [1] 0 290s 290s > libgit2_features() 290s $threads 290s [1] TRUE 290s 290s $https 290s [1] TRUE 290s 290s $ssh 290s [1] TRUE 290s 290s > 290s > 290s > ## Initialize a temporary repository 290s > path <- tempfile(pattern = "git2r-") 290s > dir.create(path) 290s > repo <- init(path, branch = "main") 290s > 290s > ## Create a user and commit a file 290s > config(repo, user.name = "Author", user.email = "author@example.org") 290s > writeLines(c("First line in file 1.", "Second line in file 1."), 290s + file.path(path, "example-1.txt")) 290s > add(repo, "example-1.txt") 290s > commit(repo, "First commit message") 290s [dc92426] 2025-03-15: First commit message 290s > 290s > ## Create and add one more file 290s > writeLines(c("First line in file 2.", "Second line in file 2."), 290s + file.path(path, "example-2.txt")) 290s > add(repo, "example-2.txt") 290s > commit(repo, "Second commit message") 290s [1a88ca7] 2025-03-15: Second commit message 290s > 290s > ## Create a new branch 'fix' 290s > checkout(repo, "fix", create = TRUE) 290s > 290s > ## Update 'example-1.txt' (swap words in first line) and commit 290s > writeLines(c("line First in file 1.", "Second line in file 1."), 290s + file.path(path, "example-1.txt")) 290s > add(repo, "example-1.txt") 290s > commit(repo, "Third commit message") 290s [36cc54d] 2025-03-15: Third commit message 290s > 290s > checkout(repo, "main") 290s > 290s > ## Update 'example-2.txt' (swap words in second line) and commit 290s > writeLines(c("First line in file 2.", "line Second in file 2."), 290s + file.path(path, "example-2.txt")) 290s > add(repo, "example-2.txt") 290s > commit(repo, "Fourth commit message") 290s [a4fc785] 2025-03-15: Fourth commit message 290s > 290s > # Missing branch to merge with should throw an error 290s > tools::assertError(merge(repo)) 290s > 290s > ## Merge 'fix' 290s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 290s > stopifnot(identical(format(m), "Merge")) 290s > 290s > ## Merge 'fix' again 290s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 290s > stopifnot(identical(format(m), "Already up-to-date")) 290s > 290s > ## Check number of parents of each commit 290s > stopifnot(identical(sapply(commits(repo), function(x) length(parents(x))), 290s + c(2L, 1L, 1L, 1L, 0L))) 290s > 290s > ## Check that last commit is a merge 290s > stopifnot(is_merge(last_commit(repo))) 290s > summary(last_commit(repo)) 290s Commit: b290b2f4b09821902b7679598f922e0c89972715 290s Merge: a4fc7854a52ee6900d7887ff15e0837bde3fae97 290s 36cc54d1fb1c35b79b83caa193283b818471d736 290s Author: Author 290s When: 2025-03-15 16:15:19 GMT 290s 290s merge fix 290s 290s Commit message: a4fc7854a52ee6900d7887ff15e0837bde3fae97 290s Fourth commit message 290s 290s Commit message: 36cc54d1fb1c35b79b83caa193283b818471d736 290s Third commit message 290s 290s > 290s > ## Check that metadata associated with merge is removed 290s > stopifnot(!file.exists(file.path(path, ".git", "MERGE_HEAD"))) 290s > 290s > ## Cleanup 290s > unlink(path, recursive = TRUE) 290s > 290s BEGIN TEST note.R 290s 290s R version 4.4.3 (2025-02-28) -- "Trophy Case" 290s Copyright (C) 2025 The R Foundation for Statistical Computing 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s 290s R is free software and comes with ABSOLUTELY NO WARRANTY. 290s You are welcome to redistribute it under certain conditions. 290s Type 'license()' or 'licence()' for distribution details. 290s 290s R is a collaborative project with many contributors. 290s Type 'contributors()' for more information and 290s 'citation()' on how to cite R or R packages in publications. 290s 290s Type 'demo()' for some demos, 'help()' for on-line help, or 290s 'help.start()' for an HTML browser interface to help. 290s Type 'q()' to quit R. 290s 290s > ## git2r, R bindings to the libgit2 library. 290s > ## Copyright (C) 2013-2023 The git2r contributors 290s > ## 290s > ## This program is free software; you can redistribute it and/or modify 290s > ## it under the terms of the GNU General Public License, version 2, 290s > ## as published by the Free Software Foundation. 290s > ## 290s > ## git2r is distributed in the hope that it will be useful, 290s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 290s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 290s > ## GNU General Public License for more details. 290s > ## 290s > ## You should have received a copy of the GNU General Public License along 290s > ## with this program; if not, write to the Free Software Foundation, Inc., 290s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 290s > 290s > library("git2r") 290s > 290s > ## For debugging 290s > sessionInfo() 290s R version 4.4.3 (2025-02-28) 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s Running under: Ubuntu Plucky Puffin (development branch) 290s 290s Matrix products: default 290s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 290s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 290s 290s locale: 290s [1] C 290s 290s time zone: Etc/UTC 290s tzcode source: system (glibc) 290s 290s attached base packages: 290s [1] stats graphics grDevices utils datasets methods base 290s 290s other attached packages: 290s [1] git2r_0.35.0 290s 290s loaded via a namespace (and not attached): 290s [1] compiler_4.4.3 290s > libgit2_version() 290s $major 290s [1] 1 290s 290s $minor 290s [1] 9 290s 290s $rev 290s [1] 0 290s 290s > libgit2_features() 290s $threads 290s [1] TRUE 290s 290s $https 290s [1] TRUE 290s 290s $ssh 290s [1] TRUE 290s 290s > 290s > 290s > ## Create a directory in tempdir 290s > path <- tempfile(pattern = "git2r-") 290s > dir.create(path) 290s > 290s > ## Initialize a repository 290s > repo <- init(path) 290s > config(repo, user.name = "Alice", user.email = "alice@example.org") 290s > 290s > ## Create a file, add and commit 290s > writeLines("Hello world!", file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit_1 <- commit(repo, "Commit message 1") 290s > 290s > ## Create another commit 290s > writeLines(c("Hello world!", 290s + "HELLO WORLD!"), 290s + file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit_2 <- commit(repo, "Commit message 2") 290s > 290s > ## Check default ref 290s > stopifnot(identical(note_default_ref(repo), 290s + "refs/notes/commits")) 290s > 290s > ## Check that an invalid object argument in note_create produce an 290s > ## error. 290s > tools::assertError(note_create(object = NULL, message = "test")) 290s > tools::assertError(note_create(object = 1, message = "test")) 290s > 290s > ## Check that notes is an empty list 290s > stopifnot(identical(notes(repo), list())) 290s > 290s > ## Create note in default namespace 290s > note_1 <- note_create(commit_1, "Note-1") 290s > stopifnot(identical(print(note_1), note_1)) 290s note: a801dfb10a85d13bc8ab304a9255b5cf180f94dd 290s > stopifnot(identical(length(notes(repo)), 1L)) 290s > stopifnot(identical(sha(note_1), note_1$sha)) 290s > tools::assertError(note_create(commit_1, "Note-2")) 290s > note_2 <- note_create(commit_1, "Note-2", force = TRUE) 290s > stopifnot(identical(length(notes(repo)), 1L)) 290s > 290s > ## Check that an invalid note argument in note_remove produce an 290s > ## error. 290s > tools::assertError(note_remove(note = 1)) 290s > 290s > ## Create note in named (review) namespace 290s > note_3 <- note_create(commit_1, "Note-3", ref = "refs/notes/review") 290s > note_4 <- note_create(commit_2, "Note-4", ref = "refs/notes/review") 290s > stopifnot(identical(length(notes(repo, ref = "refs/notes/review")), 2L)) 290s > note_remove(note_3) 290s > note_remove(note_4) 290s > stopifnot(identical(notes(repo, ref = "refs/notes/review"), list())) 290s > note_5 <- note_create(commit_1, "Note-5", ref = "review") 290s > note_6 <- note_create(commit_2, "Note-6", ref = "review") 290s > stopifnot(identical(length(notes(repo, ref = "review")), 2L)) 290s > note_remove(note_5) 290s > note_remove(note_6) 290s > stopifnot(identical(length(notes(repo, ref = "review")), 0L)) 290s > 290s > ## Create note on blob and tree 290s > tree_1 <- tree(commit_1) 290s > note_7 <- note_create(tree_1, "Note-7") 290s > stopifnot(is(object = lookup(repo, note_7$annotated), class2 = "git_tree")) 290s > stopifnot(identical(length(notes(repo)), 2L)) 290s > blob_1 <- lookup(repo, tree_1$id[1]) 290s > note_8 <- note_create(blob_1, "Note-8") 290s > stopifnot(is(object = lookup(repo, note_8$annotated), class2 = "git_blob")) 290s > stopifnot(identical(length(notes(repo)), 3L)) 290s > 290s > ## Cleanup 290s > unlink(path, recursive = TRUE) 290s > 290s BEGIN TEST odb_blobs.R 290s 290s R version 4.4.3 (2025-02-28) -- "Trophy Case" 290s Copyright (C) 2025 The R Foundation for Statistical Computing 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s 290s R is free software and comes with ABSOLUTELY NO WARRANTY. 290s You are welcome to redistribute it under certain conditions. 290s Type 'license()' or 'licence()' for distribution details. 290s 290s R is a collaborative project with many contributors. 290s Type 'contributors()' for more information and 290s 'citation()' on how to cite R or R packages in publications. 290s 290s Type 'demo()' for some demos, 'help()' for on-line help, or 290s 'help.start()' for an HTML browser interface to help. 290s Type 'q()' to quit R. 290s 290s > ## git2r, R bindings to the libgit2 library. 290s > ## Copyright (C) 2013-2023 The git2r contributors 290s > ## 290s > ## This program is free software; you can redistribute it and/or modify 290s > ## it under the terms of the GNU General Public License, version 2, 290s > ## as published by the Free Software Foundation. 290s > ## 290s > ## git2r is distributed in the hope that it will be useful, 290s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 290s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 290s > ## GNU General Public License for more details. 290s > ## 290s > ## You should have received a copy of the GNU General Public License along 290s > ## with this program; if not, write to the Free Software Foundation, Inc., 290s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 290s > 290s > library("git2r") 290s > 290s > ## For debugging 290s > sessionInfo() 290s R version 4.4.3 (2025-02-28) 290s Platform: arm-unknown-linux-gnueabihf (32-bit) 290s Running under: Ubuntu Plucky Puffin (development branch) 290s 290s Matrix products: default 290s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 290s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 290s 290s locale: 290s [1] C 290s 290s time zone: Etc/UTC 290s tzcode source: system (glibc) 290s 290s attached base packages: 290s [1] stats graphics grDevices utils datasets methods base 290s 290s other attached packages: 290s [1] git2r_0.35.0 290s 290s loaded via a namespace (and not attached): 290s [1] compiler_4.4.3 290s > libgit2_version() 290s $major 290s [1] 1 290s 290s $minor 290s [1] 9 290s 290s $rev 290s [1] 0 290s 290s > libgit2_features() 290s $threads 290s [1] TRUE 290s 290s $https 290s [1] TRUE 290s 290s $ssh 290s [1] TRUE 290s 290s > 290s > 290s > ## Create a directory in tempdir 290s > path <- tempfile(pattern = "git2r-") 290s > dir.create(path) 290s > 290s > ## Initialize a repository 290s > repo <- init(path) 290s > config(repo, user.name = "Alice", user.email = "alice@@example.org") 290s > 290s > ## Create a file, add and commit 290s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 290s + con = file.path(path, "test.txt")) 290s > add(repo, "test.txt") 290s > commit(repo, "Commit message 1") 291s [2e4ccaa] 2025-03-15: Commit message 1 291s > 291s > ## Change file and commit 291s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 291s + con = file.path(path, "test.txt")) 291s > add(repo, "test.txt") 291s > commit(repo, "Commit message 2") 291s [9fc361c] 2025-03-15: Commit message 2 291s > 291s > ## Commit same content under different name in a sub-directory 291s > dir.create(file.path(path, "sub-directory")) 291s > file.copy(file.path(path, "test.txt"), 291s + file.path(path, "sub-directory", "copy.txt")) 291s [1] TRUE 291s > add(repo, "sub-directory/copy.txt") 291s > commit(repo, "Commit message 3") 291s [a84b98f] 2025-03-15: Commit message 3 291s > 291s > ## List blobs 291s > b <- odb_blobs(repo) 291s > 291s > ## Order the data.frame before checking 291s > b <- b[order(b$name), ] 291s > 291s > ## Check blobs 291s > stopifnot(identical(nrow(b), 3L)) 291s > stopifnot(identical( 291s + colnames(b), 291s + c("sha", "path", "name", "len", "commit", "author", "when"))) 291s > stopifnot(identical(b$path, c("sub-directory", "", ""))) 291s > stopifnot(identical(b$name, c("copy.txt", "test.txt", "test.txt"))) 291s > stopifnot(identical(b$author, c("Alice", "Alice", "Alice"))) 291s > 291s > ## Cleanup 291s > unlink(path, recursive = TRUE) 291s > 291s BEGIN TEST pre-process-path.R 291s 291s R version 4.4.3 (2025-02-28) -- "Trophy Case" 291s Copyright (C) 2025 The R Foundation for Statistical Computing 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s 291s R is free software and comes with ABSOLUTELY NO WARRANTY. 291s You are welcome to redistribute it under certain conditions. 291s Type 'license()' or 'licence()' for distribution details. 291s 291s R is a collaborative project with many contributors. 291s Type 'contributors()' for more information and 291s 'citation()' on how to cite R or R packages in publications. 291s 291s Type 'demo()' for some demos, 'help()' for on-line help, or 291s 'help.start()' for an HTML browser interface to help. 291s Type 'q()' to quit R. 291s 291s > ## git2r, R bindings to the libgit2 library. 291s > ## Copyright (C) 2013-2023 The git2r contributors 291s > ## 291s > ## This program is free software; you can redistribute it and/or modify 291s > ## it under the terms of the GNU General Public License, version 2, 291s > ## as published by the Free Software Foundation. 291s > ## 291s > ## git2r is distributed in the hope that it will be useful, 291s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 291s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 291s > ## GNU General Public License for more details. 291s > ## 291s > ## You should have received a copy of the GNU General Public License along 291s > ## with this program; if not, write to the Free Software Foundation, Inc., 291s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 291s > 291s > library(git2r) 291s > source("util/check.R") 291s > 291s > ## For debugging 291s > sessionInfo() 291s R version 4.4.3 (2025-02-28) 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s Running under: Ubuntu Plucky Puffin (development branch) 291s 291s Matrix products: default 291s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 291s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 291s 291s locale: 291s [1] C 291s 291s time zone: Etc/UTC 291s tzcode source: system (glibc) 291s 291s attached base packages: 291s [1] stats graphics grDevices utils datasets methods base 291s 291s other attached packages: 291s [1] git2r_0.35.0 291s 291s loaded via a namespace (and not attached): 291s [1] compiler_4.4.3 291s > libgit2_version() 291s $major 291s [1] 1 291s 291s $minor 291s [1] 9 291s 291s $rev 291s [1] 0 291s 291s > libgit2_features() 291s $threads 291s [1] TRUE 291s 291s $https 291s [1] TRUE 291s 291s $ssh 291s [1] TRUE 291s 291s > 291s > 291s > ## Create a directory in tempdir 291s > path <- tempfile(pattern = "git2r-") 291s > dir.create(path) 291s > setwd(path) 291s > 291s > ## Initialize a repository 291s > repo <- init(path) 291s > config(repo, user.name = "Alice", user.email = "alice@example.org") 291s > 291s > ## Test to add file with a leading './' 291s > writeLines("foo-1", file.path(path, "foo-1")) 291s > add(repo, "./foo-1") 291s > status_exp <- structure(list(staged = list(new = "foo-1"), 291s + unstaged = empty_named_list(), 291s + untracked = empty_named_list()), 291s + class = "git_status") 291s > status_obs <- status(repo) 291s > str(status_exp) 291s List of 3 291s $ staged :List of 1 291s ..$ new: chr "foo-1" 291s $ unstaged : Named list() 291s $ untracked: Named list() 291s - attr(*, "class")= chr "git_status" 291s > str(status_obs) 291s List of 3 291s $ staged :List of 1 291s ..$ new: chr "foo-1" 291s $ unstaged : Named list() 291s $ untracked: Named list() 291s - attr(*, "class")= chr "git_status" 291s > stopifnot(identical(status_obs, status_exp)) 291s > 291s > ## Test to add file in sub-folder with sub-folder as working directory 291s > writeLines("foo-2", file.path(path, "foo-2")) 291s > dir.create(file.path(path, "foo_dir")) 291s > writeLines("foo-2", file.path(path, "foo_dir/foo-2")) 291s > setwd("./foo_dir") 291s > add(repo, "foo-2") 291s > status_exp <- structure(list(staged = list(new = "foo-1", 291s + new = "foo_dir/foo-2"), 291s + unstaged = empty_named_list(), 291s + untracked = list(untracked = "foo-2")), 291s + class = "git_status") 291s > status_obs <- status(repo) 291s > str(status_exp) 291s List of 3 291s $ staged :List of 2 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > str(status_obs) 291s List of 3 291s $ staged :List of 2 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > stopifnot(identical(status_obs, status_exp)) 291s > 291s > ## Test glob expansion 291s > setwd(tempdir()) 291s > dir.create(file.path(path, "glob_dir")) 291s > writeLines("a", file.path(path, "glob_dir/a.txt")) 291s > writeLines("b", file.path(path, "glob_dir/b.txt")) 291s > writeLines("c", file.path(path, "glob_dir/c.txt")) 291s > writeLines("d", file.path(path, "glob_dir/d.md")) 291s > add(repo, "glob_dir/*txt") 291s > status_exp <- structure(list(staged = list(new = "foo-1", 291s + new = "foo_dir/foo-2", 291s + new = "glob_dir/a.txt", 291s + new = "glob_dir/b.txt", 291s + new = "glob_dir/c.txt"), 291s + unstaged = empty_named_list(), 291s + untracked = list(untracked = "foo-2", 291s + untracked = "glob_dir/d.md")), 291s + class = "git_status") 291s > status_obs <- status(repo) 291s > str(status_exp) 291s List of 3 291s $ staged :List of 5 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s $ unstaged : Named list() 291s $ untracked:List of 2 291s ..$ untracked: chr "foo-2" 291s ..$ untracked: chr "glob_dir/d.md" 291s - attr(*, "class")= chr "git_status" 291s > str(status_obs) 291s List of 3 291s $ staged :List of 5 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s $ unstaged : Named list() 291s $ untracked:List of 2 291s ..$ untracked: chr "foo-2" 291s ..$ untracked: chr "glob_dir/d.md" 291s - attr(*, "class")= chr "git_status" 291s > stopifnot(identical(status_obs, status_exp)) 291s > 291s > ## Test glob expansion with relative path 291s > setwd(path) 291s > add(repo, "./glob_dir/*md") 291s > status_exp <- structure(list(staged = list(new = "foo-1", 291s + new = "foo_dir/foo-2", 291s + new = "glob_dir/a.txt", 291s + new = "glob_dir/b.txt", 291s + new = "glob_dir/c.txt", 291s + new = "glob_dir/d.md"), 291s + unstaged = empty_named_list(), 291s + untracked = list(untracked = "foo-2")), 291s + class = "git_status") 291s > status_obs <- status(repo) 291s > str(status_exp) 291s List of 3 291s $ staged :List of 6 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s ..$ new: chr "glob_dir/d.md" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > str(status_obs) 291s List of 3 291s $ staged :List of 6 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s ..$ new: chr "glob_dir/d.md" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > stopifnot(identical(status_obs, status_exp)) 291s > 291s > ## Test to add file in root of workdir when the file also exists in 291s > ## current workdir. 291s > setwd(tempdir()) 291s > writeLines("e", file.path(path, "e.txt")) 291s > writeLines("e", file.path(tempdir(), "e.txt")) 291s > add(repo, "e.txt") 291s > status_exp <- structure(list(staged = list(new = "e.txt", 291s + new = "foo-1", 291s + new = "foo_dir/foo-2", 291s + new = "glob_dir/a.txt", 291s + new = "glob_dir/b.txt", 291s + new = "glob_dir/c.txt", 291s + new = "glob_dir/d.md"), 291s + unstaged = empty_named_list(), 291s + untracked = list(untracked = "foo-2")), 291s + class = "git_status") 291s > status_obs <- status(repo) 291s > str(status_exp) 291s List of 3 291s $ staged :List of 7 291s ..$ new: chr "e.txt" 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s ..$ new: chr "glob_dir/d.md" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > str(status_obs) 291s List of 3 291s $ staged :List of 7 291s ..$ new: chr "e.txt" 291s ..$ new: chr "foo-1" 291s ..$ new: chr "foo_dir/foo-2" 291s ..$ new: chr "glob_dir/a.txt" 291s ..$ new: chr "glob_dir/b.txt" 291s ..$ new: chr "glob_dir/c.txt" 291s ..$ new: chr "glob_dir/d.md" 291s $ unstaged : Named list() 291s $ untracked:List of 1 291s ..$ untracked: chr "foo-2" 291s - attr(*, "class")= chr "git_status" 291s > stopifnot(identical(status_obs, status_exp)) 291s > 291s > ## Cleanup 291s > unlink(path, recursive = TRUE) 291s > 291s BEGIN TEST pull.R 291s 291s R version 4.4.3 (2025-02-28) -- "Trophy Case" 291s Copyright (C) 2025 The R Foundation for Statistical Computing 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s 291s R is free software and comes with ABSOLUTELY NO WARRANTY. 291s You are welcome to redistribute it under certain conditions. 291s Type 'license()' or 'licence()' for distribution details. 291s 291s R is a collaborative project with many contributors. 291s Type 'contributors()' for more information and 291s 'citation()' on how to cite R or R packages in publications. 291s 291s Type 'demo()' for some demos, 'help()' for on-line help, or 291s 'help.start()' for an HTML browser interface to help. 291s Type 'q()' to quit R. 291s 291s > ## git2r, R bindings to the libgit2 library. 291s > ## Copyright (C) 2013-2023 The git2r contributors 291s > ## 291s > ## This program is free software; you can redistribute it and/or modify 291s > ## it under the terms of the GNU General Public License, version 2, 291s > ## as published by the Free Software Foundation. 291s > ## 291s > ## git2r is distributed in the hope that it will be useful, 291s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 291s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 291s > ## GNU General Public License for more details. 291s > ## 291s > ## You should have received a copy of the GNU General Public License along 291s > ## with this program; if not, write to the Free Software Foundation, Inc., 291s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 291s > 291s > library(git2r) 291s > 291s > ## For debugging 291s > sessionInfo() 291s R version 4.4.3 (2025-02-28) 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s Running under: Ubuntu Plucky Puffin (development branch) 291s 291s Matrix products: default 291s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 291s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 291s 291s locale: 291s [1] C 291s 291s time zone: Etc/UTC 291s tzcode source: system (glibc) 291s 291s attached base packages: 291s [1] stats graphics grDevices utils datasets methods base 291s 291s other attached packages: 291s [1] git2r_0.35.0 291s 291s loaded via a namespace (and not attached): 291s [1] compiler_4.4.3 291s > libgit2_version() 291s $major 291s [1] 1 291s 291s $minor 291s [1] 9 291s 291s $rev 291s [1] 0 291s 291s > libgit2_features() 291s $threads 291s [1] TRUE 291s 291s $https 291s [1] TRUE 291s 291s $ssh 291s [1] TRUE 291s 291s > 291s > 291s > ## Create directories for repositories in tempdir 291s > path_bare <- tempfile(pattern = "git2r-") 291s > path_repo_1 <- tempfile(pattern = "git2r-") 291s > path_repo_2 <- tempfile(pattern = "git2r-") 291s > 291s > dir.create(path_bare) 291s > dir.create(path_repo_1) 291s > dir.create(path_repo_2) 291s > 291s > ## Create bare repository 291s > bare_repo <- init(path_bare, bare = TRUE) 291s > 291s > ## Clone to repo 1 291s > repo_1 <- clone(path_bare, path_repo_1) 291s cloning into '/tmp/RtmpeewD2U/git2r-85f633aaa46'... 291s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 291s > 291s > ## Add changes to repo 1 and push to bare 291s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + con = file.path(path_repo_1, "test-1.txt")) 291s > add(repo_1, "test-1.txt") 291s > commit_1 <- commit(repo_1, "First commit message") 291s > branch_name <- branches(repo_1)[[1]]$name 291s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 291s > 291s > ## Clone to repo 2 291s > repo_2 <- clone(path_bare, path_repo_2) 291s cloning into '/tmp/RtmpeewD2U/git2r-85f4d305f8d'... 291s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 291s > 291s > ## Add more changes to repo 1 and push to bare 291s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 291s + con = file.path(path_repo_1, "test-1.txt")) 291s > add(repo_1, "test-1.txt") 291s > commit_2 <- commit(repo_1, "Second commit message") 291s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 291s > 291s > ## Pull changes to repo_2 291s > pull(repo_2) 291s [updated] bfe301c799..7eaa063f32 refs/remotes/origin/master 291s Merge: Fast-forward 291s > stopifnot(identical(length(commits(repo_2)), 2L)) 291s > 291s > ## Check remote url of repo_2 291s > stopifnot(identical( 291s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 291s + path_bare)) 291s > 291s > ## Unset remote remote tracking branch 291s > branch_set_upstream(repository_head(repo_2), NULL) 291s > stopifnot(is.null(branch_get_upstream(repository_head(repo_2)))) 291s > tools::assertError(pull(repo_2)) 291s > tools::assertError(branch_set_upstream(repository_head(repo_2), NULL)) 291s > 291s > ## Add more changes to repo 1 and push to bare 291s > writeLines( 291s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 291s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 291s + con = file.path(path_repo_1, "test-1.txt")) 291s > add(repo_1, "test-1.txt") 291s > commit_3 <- commit(repo_1, "Third commit message") 291s > push(repo_1) 291s > 291s > ## Set remote tracking branch 291s > branch_set_upstream(repository_head(repo_2), 291s + paste0("origin/", branch_name)) 291s > stopifnot(identical( 291s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 291s + path_bare)) 291s > 291s > ## Pull changes to repo_2 291s > pull(repo_2) 291s [updated] 7eaa063f32..8609fa8e1b refs/remotes/origin/master 291s Merge: Fast-forward 291s > stopifnot(identical(length(commits(repo_2)), 3L)) 291s > 291s > ## Check references in repo_1 and repo_2. Must clear the repo item 291s > ## since the repositories have different paths. 291s > stopifnot(identical(length(references(repo_1)), 2L)) 291s > 291s > ref_1 <- references(repo_1) 291s > lapply(seq_len(length(ref_1)), function(i) { 291s + ref_1[[i]]$repo <<- NULL 291s + }) 291s [[1]] 291s NULL 291s 291s [[2]] 291s NULL 291s 291s > 291s > ref_2 <- references(repo_2) 291s > lapply(seq_len(length(ref_2)), function(i) { 291s + ref_2[[i]]$repo <<- NULL 291s + }) 291s [[1]] 291s NULL 291s 291s [[2]] 291s NULL 291s 291s [[3]] 291s NULL 291s 291s > 291s > name <- paste0("refs/heads/", branch_name) 291s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 291s > 291s > name <- paste0("refs/remotes/", branch_name) 291s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 291s > 291s > ref_1 <- references(repo_1)[[paste0("refs/heads/", branch_name)]] 291s > stopifnot(identical(ref_1$name, paste0("refs/heads/", branch_name))) 291s > stopifnot(identical(ref_1$type, 1L)) 291s > stopifnot(identical(sha(ref_1), sha(commit_3))) 291s > stopifnot(identical(ref_1$target, NA_character_)) 291s > stopifnot(identical(ref_1$shorthand, branch_name)) 291s > 291s > ref_2 <- references(repo_1)[[paste0("refs/remotes/origin/", branch_name)]] 291s > stopifnot(identical(ref_2$name, paste0("refs/remotes/origin/", branch_name))) 291s > stopifnot(identical(ref_2$type, 1L)) 291s > stopifnot(identical(sha(ref_2), sha(commit_3))) 291s > stopifnot(identical(ref_2$target, NA_character_)) 291s > stopifnot(identical(ref_2$shorthand, paste0("origin/", branch_name))) 291s > 291s > ## Check references with missing repo argument 291s > wd <- setwd(path_repo_1) 291s > stopifnot(identical(length(references()), 2L)) 291s > if (!is.null(wd)) 291s + setwd(wd) 291s > 291s > ## Cleanup 291s > unlink(path_bare, recursive = TRUE) 291s > unlink(path_repo_1, recursive = TRUE) 291s > unlink(path_repo_2, recursive = TRUE) 291s > 291s BEGIN TEST push-force.R 291s 291s R version 4.4.3 (2025-02-28) -- "Trophy Case" 291s Copyright (C) 2025 The R Foundation for Statistical Computing 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s 291s R is free software and comes with ABSOLUTELY NO WARRANTY. 291s You are welcome to redistribute it under certain conditions. 291s Type 'license()' or 'licence()' for distribution details. 291s 291s R is a collaborative project with many contributors. 291s Type 'contributors()' for more information and 291s 'citation()' on how to cite R or R packages in publications. 291s 291s Type 'demo()' for some demos, 'help()' for on-line help, or 291s 'help.start()' for an HTML browser interface to help. 291s Type 'q()' to quit R. 291s 291s > ## git2r, R bindings to the libgit2 library. 291s > ## Copyright (C) 2013-2023 The git2r contributors 291s > ## 291s > ## This program is free software; you can redistribute it and/or modify 291s > ## it under the terms of the GNU General Public License, version 2, 291s > ## as published by the Free Software Foundation. 291s > ## 291s > ## git2r is distributed in the hope that it will be useful, 291s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 291s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 291s > ## GNU General Public License for more details. 291s > ## 291s > ## You should have received a copy of the GNU General Public License along 291s > ## with this program; if not, write to the Free Software Foundation, Inc., 291s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 291s > 291s > library(git2r) 291s > 291s > ## For debugging 291s > sessionInfo() 291s R version 4.4.3 (2025-02-28) 291s Platform: arm-unknown-linux-gnueabihf (32-bit) 291s Running under: Ubuntu Plucky Puffin (development branch) 291s 291s Matrix products: default 291s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 291s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 291s 291s locale: 291s [1] C 291s 291s time zone: Etc/UTC 291s tzcode source: system (glibc) 291s 291s attached base packages: 291s [1] stats graphics grDevices utils datasets methods base 291s 291s other attached packages: 291s [1] git2r_0.35.0 291s 291s loaded via a namespace (and not attached): 291s [1] compiler_4.4.3 291s > libgit2_version() 291s $major 291s [1] 1 291s 291s $minor 291s [1] 9 291s 291s $rev 291s [1] 0 291s 291s > libgit2_features() 291s $threads 291s [1] TRUE 291s 291s $https 291s [1] TRUE 291s 291s $ssh 291s [1] TRUE 291s 291s > 291s > 291s > ## Create directories for repositories in tempdir 291s > path_bare <- tempfile(pattern = "git2r-") 291s > path_repo_1 <- tempfile(pattern = "git2r-") 291s > path_repo_2 <- tempfile(pattern = "git2r-") 291s > 291s > dir.create(path_bare) 291s > dir.create(path_repo_1) 291s > dir.create(path_repo_2) 291s > 291s > ## Create bare repository 291s > bare_repo <- init(path_bare, bare = TRUE) 291s > 291s > ## Clone to repo 1 291s > repo_1 <- clone(path_bare, path_repo_1) 291s cloning into '/tmp/RtmpB788qg/git2r-86e471f3feb'... 291s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 291s > 291s > ## Add changes to repo 1 and push to bare 291s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + con = file.path(path_repo_1, "test-1.txt")) 291s > add(repo_1, "test-1.txt") 291s > commit_1 <- commit(repo_1, "First commit message") 291s > branch_name <- branches(repo_1)[[1]]$name 291s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 291s > 291s > ## Clone to repo 2 291s > repo_2 <- clone(path_bare, path_repo_2) 291s cloning into '/tmp/RtmpB788qg/git2r-86e3b9e2eae'... 291s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 291s > 291s > ## Add more changes to repo 1 and push to bare 291s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 291s + con = file.path(path_repo_1, "test-1.txt")) 291s > add(repo_1, "test-1.txt") 291s > commit_2 <- commit(repo_1, "Second commit message") 291s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 291s > 291s > ## Add changes to repo 2 and push to bare 291s > writeLines( 291s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 291s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 291s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 291s + con = file.path(path_repo_2, "test-1.txt")) 291s > add(repo_2, "test-1.txt") 291s > commit_3 <- commit(repo_2, "Third commit message") 291s > 291s > ## We are behind, so this should fail 291s > tools::assertError(push(repo_2)) 291s > 291s > ## Push with force = TRUE 291s > push(repo_2, force = TRUE) 291s > 291s > ## Check commits 291s > stopifnot(identical(length(commits(bare_repo)), 2L)) 291s > stopifnot(identical(sha(commits(repo_2)[[1]]), sha(commits(bare_repo)[[1]]))) 291s > stopifnot(identical(sha(commits(repo_2)[[2]]), sha(commits(bare_repo)[[2]]))) 291s > 291s > ## Cleanup 291s > unlink(path_bare, recursive = TRUE) 291s > unlink(path_repo_1, recursive = TRUE) 291s > unlink(path_repo_2, recursive = TRUE) 292s > 292s BEGIN TEST push.R 292s 292s R version 4.4.3 (2025-02-28) -- "Trophy Case" 292s Copyright (C) 2025 The R Foundation for Statistical Computing 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s 292s R is free software and comes with ABSOLUTELY NO WARRANTY. 292s You are welcome to redistribute it under certain conditions. 292s Type 'license()' or 'licence()' for distribution details. 292s 292s R is a collaborative project with many contributors. 292s Type 'contributors()' for more information and 292s 'citation()' on how to cite R or R packages in publications. 292s 292s Type 'demo()' for some demos, 'help()' for on-line help, or 292s 'help.start()' for an HTML browser interface to help. 292s Type 'q()' to quit R. 292s 292s > ## git2r, R bindings to the libgit2 library. 292s > ## Copyright (C) 2013-2023 The git2r contributors 292s > ## 292s > ## This program is free software; you can redistribute it and/or modify 292s > ## it under the terms of the GNU General Public License, version 2, 292s > ## as published by the Free Software Foundation. 292s > ## 292s > ## git2r is distributed in the hope that it will be useful, 292s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 292s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 292s > ## GNU General Public License for more details. 292s > ## 292s > ## You should have received a copy of the GNU General Public License along 292s > ## with this program; if not, write to the Free Software Foundation, Inc., 292s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292s > 292s > library(git2r) 292s > 292s > ## For debugging 292s > sessionInfo() 292s R version 4.4.3 (2025-02-28) 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s Running under: Ubuntu Plucky Puffin (development branch) 292s 292s Matrix products: default 292s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 292s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 292s 292s locale: 292s [1] C 292s 292s time zone: Etc/UTC 292s tzcode source: system (glibc) 292s 292s attached base packages: 292s [1] stats graphics grDevices utils datasets methods base 292s 292s other attached packages: 292s [1] git2r_0.35.0 292s 292s loaded via a namespace (and not attached): 292s [1] compiler_4.4.3 292s > libgit2_version() 292s $major 292s [1] 1 292s 292s $minor 292s [1] 9 292s 292s $rev 292s [1] 0 292s 292s > libgit2_features() 292s $threads 292s [1] TRUE 292s 292s $https 292s [1] TRUE 292s 292s $ssh 292s [1] TRUE 292s 292s > 292s > 292s > ## Create 2 directories in tempdir 292s > path_bare <- tempfile(pattern = "git2r-") 292s > path_repo <- tempfile(pattern = "git2r-") 292s > 292s > dir.create(path_bare) 292s > dir.create(path_repo) 292s > 292s > ## Create repositories 292s > bare_repo <- init(path_bare, bare = TRUE) 292s > repo <- clone(path_bare, path_repo) 292s cloning into '/tmp/RtmpJdlQKS/git2r-87a216f3968'... 292s > 292s > ## Check the repositores 292s > stopifnot(identical(is_bare(bare_repo), TRUE)) 292s > stopifnot(identical(is_bare(repo), FALSE)) 292s > 292s > ## Config repositories 292s > config(repo, user.name = "Alice", user.email = "alice@example.org") 292s > 292s > ## Add changes to repo 292s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 292s > add(repo, "test.txt") 292s > commit_1 <- commit(repo, "Commit message") 292s > branch_name <- branches(repo)[[1]]$name 292s > 292s > ## Check commit 292s > stopifnot(identical(commit_1$author$name, "Alice")) 292s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 292s > stopifnot(identical(length(commits(repo)), 1L)) 292s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 292s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 292s > 292s > ## Check push arguments 292s > tools::assertError(push(repo, character(0), paste0("refs/heads/", branch_name))) 292s > tools::assertError(push(repo, NA_character_, paste0("refs/heads/", branch_name))) 292s > tools::assertError(push(repo, c("origin", "origin"), paste0("refs/heads/", branch_name))) 292s > tools::assertError(push(repo, "origin")) 292s > tools::assertError(push(repo, name = "origin")) 292s > push(repo, "origin", character(0)) 292s > push(repo, "origin", NA_character_) 292s > push(repo, "origin", c(NA_character_, NA_character_)) 292s > stopifnot(identical(reflog(repo, paste0("refs/remotes/origin/", branch_name)), 292s + structure(list(), class = "git_reflog"))) 292s > 292s > ## No tracking branch assigned to master 292s > tools::assertError(push(branches(repo)[[1]])) 292s > 292s > ## Push changes from repo to origin 292s > push(repo, "origin", paste0("refs/heads/", branch_name)) 292s > r <- reflog(repo, paste0("refs/remotes/origin/", branch_name)) 292s > stopifnot(identical(length(r), 1L)) 292s > r <- r[[1]] 292s > stopifnot(identical(sha(r), sha(commit_1))) 292s > stopifnot(identical(r$message, "update by push")) 292s > stopifnot(identical(r$index, 0L)) 292s > stopifnot(identical(r$committer$name, "Alice")) 292s > stopifnot(identical(r$committer$email, "alice@example.org")) 292s > stopifnot(identical(r$refname, paste0("refs/remotes/origin/", branch_name))) 292s > stopifnot(identical(r$repo$path, repo$path)) 292s > push(branches(repo)[[1]]) 292s > 292s > ## Check result in bare repository 292s > stopifnot(identical(length(commits(bare_repo)), 1L)) 292s > bare_commit_1 <- commits(bare_repo)[[1]] 292s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 292s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 292s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 292s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 292s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 292s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 292s > 292s > ## Add changes to repo and push head 292s > writeLines(c("Hello world", "HELLO WORLD"), 292s + con = file.path(path_repo, "test.txt")) 292s > add(repo, "test.txt") 292s > commit_2 <- commit(repo, "Commit message 2") 292s > push(repo) 292s > bare_commit_2 <- lookup(bare_repo, sha(commit_2)) 292s > stopifnot(identical(sha(commit_2), sha(bare_commit_2))) 292s > stopifnot(identical(commit_2$author, bare_commit_2$author)) 292s > stopifnot(identical(commit_2$committer, bare_commit_2$committer)) 292s > stopifnot(identical(commit_2$summary, bare_commit_2$summary)) 292s > stopifnot(identical(commit_2$message, bare_commit_2$message)) 292s > stopifnot(!identical(commit_2$repo, bare_commit_2$repo)) 292s > 292s > ## Check 'set_upstream' 292s > branch_set_upstream(repository_head(repo), NULL) 292s > push(repo, "origin", paste0("refs/heads/", branch_name)) 292s > stopifnot(is.null(branch_get_upstream(repository_head(repo)))) 292s > push(repo, "origin", paste0("refs/heads/", branch_name), set_upstream = TRUE) 292s > stopifnot(!is.null(branch_get_upstream(repository_head(repo)))) 292s > 292s > ## Cleanup 292s > unlink(path_bare, recursive = TRUE) 292s > unlink(path_repo, recursive = TRUE) 292s > 292s BEGIN TEST reference.R 292s 292s R version 4.4.3 (2025-02-28) -- "Trophy Case" 292s Copyright (C) 2025 The R Foundation for Statistical Computing 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s 292s R is free software and comes with ABSOLUTELY NO WARRANTY. 292s You are welcome to redistribute it under certain conditions. 292s Type 'license()' or 'licence()' for distribution details. 292s 292s R is a collaborative project with many contributors. 292s Type 'contributors()' for more information and 292s 'citation()' on how to cite R or R packages in publications. 292s 292s Type 'demo()' for some demos, 'help()' for on-line help, or 292s 'help.start()' for an HTML browser interface to help. 292s Type 'q()' to quit R. 292s 292s > ## git2r, R bindings to the libgit2 library. 292s > ## Copyright (C) 2013-2023 The git2r contributors 292s > ## 292s > ## This program is free software; you can redistribute it and/or modify 292s > ## it under the terms of the GNU General Public License, version 2, 292s > ## as published by the Free Software Foundation. 292s > ## 292s > ## git2r is distributed in the hope that it will be useful, 292s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 292s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 292s > ## GNU General Public License for more details. 292s > ## 292s > ## You should have received a copy of the GNU General Public License along 292s > ## with this program; if not, write to the Free Software Foundation, Inc., 292s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292s > 292s > library(git2r) 292s > 292s > ## For debugging 292s > sessionInfo() 292s R version 4.4.3 (2025-02-28) 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s Running under: Ubuntu Plucky Puffin (development branch) 292s 292s Matrix products: default 292s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 292s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 292s 292s locale: 292s [1] C 292s 292s time zone: Etc/UTC 292s tzcode source: system (glibc) 292s 292s attached base packages: 292s [1] stats graphics grDevices utils datasets methods base 292s 292s other attached packages: 292s [1] git2r_0.35.0 292s 292s loaded via a namespace (and not attached): 292s [1] compiler_4.4.3 292s > libgit2_version() 292s $major 292s [1] 1 292s 292s $minor 292s [1] 9 292s 292s $rev 292s [1] 0 292s 292s > libgit2_features() 292s $threads 292s [1] TRUE 292s 292s $https 292s [1] TRUE 292s 292s $ssh 292s [1] TRUE 292s 292s > 292s > 292s > ## Create a directory in tempdir 292s > path <- tempfile(pattern = "git2r-") 292s > dir.create(path) 292s > 292s > ## Initialize a repository 292s > repo <- init(path, branch = "main") 292s > config(repo, user.name = "Alice", user.email = "alice@example.org") 292s > 292s > ## Create a file 292s > writeLines("Hello world!", file.path(path, "test.txt")) 292s > 292s > ## add and commit 292s > add(repo, "test.txt") 292s > commit(repo, "Commit message") 292s [6b4b574] 2025-03-15: Commit message 292s > 292s > ## Check dwim of reference shorthand 292s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "")$name, 292s + "refs/heads/main")) 292s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "main")$name, 292s + "refs/heads/main")) 292s > stopifnot(identical( 292s + .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main")$name, 292s + "refs/heads/main")) 292s > 292s > ## print reference 292s > r <- .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main") 292s > stopifnot(identical(print(r), r)) 292s [6b4b57] main 292s > 292s > ## Cleanup 292s > unlink(path, recursive = TRUE) 292s > 292s BEGIN TEST reflog.R 292s 292s R version 4.4.3 (2025-02-28) -- "Trophy Case" 292s Copyright (C) 2025 The R Foundation for Statistical Computing 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s 292s R is free software and comes with ABSOLUTELY NO WARRANTY. 292s You are welcome to redistribute it under certain conditions. 292s Type 'license()' or 'licence()' for distribution details. 292s 292s R is a collaborative project with many contributors. 292s Type 'contributors()' for more information and 292s 'citation()' on how to cite R or R packages in publications. 292s 292s Type 'demo()' for some demos, 'help()' for on-line help, or 292s 'help.start()' for an HTML browser interface to help. 292s Type 'q()' to quit R. 292s 292s > ## git2r, R bindings to the libgit2 library. 292s > ## Copyright (C) 2013-2023 The git2r contributors 292s > ## 292s > ## This program is free software; you can redistribute it and/or modify 292s > ## it under the terms of the GNU General Public License, version 2, 292s > ## as published by the Free Software Foundation. 292s > ## 292s > ## git2r is distributed in the hope that it will be useful, 292s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 292s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 292s > ## GNU General Public License for more details. 292s > ## 292s > ## You should have received a copy of the GNU General Public License along 292s > ## with this program; if not, write to the Free Software Foundation, Inc., 292s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292s > 292s > library("git2r") 292s > 292s > ## For debugging 292s > sessionInfo() 292s R version 4.4.3 (2025-02-28) 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s Running under: Ubuntu Plucky Puffin (development branch) 292s 292s Matrix products: default 292s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 292s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 292s 292s locale: 292s [1] C 292s 292s time zone: Etc/UTC 292s tzcode source: system (glibc) 292s 292s attached base packages: 292s [1] stats graphics grDevices utils datasets methods base 292s 292s other attached packages: 292s [1] git2r_0.35.0 292s 292s loaded via a namespace (and not attached): 292s [1] compiler_4.4.3 292s > libgit2_version() 292s $major 292s [1] 1 292s 292s $minor 292s [1] 9 292s 292s $rev 292s [1] 0 292s 292s > libgit2_features() 292s $threads 292s [1] TRUE 292s 292s $https 292s [1] TRUE 292s 292s $ssh 292s [1] TRUE 292s 292s > 292s > 292s > ## Create a directory in tempdir 292s > path <- tempfile(pattern = "git2r-") 292s > dir.create(path) 292s > 292s > ## Initialize a repository 292s > repo <- init(path) 292s > config(repo, user.name = "Alice", user.email = "alice@example.org") 292s > 292s > ## Check that reflog is empty 292s > stopifnot(identical(reflog(repo), structure(list(), class = "git_reflog"))) 292s > 292s > ## Create a file 292s > writeLines("Hello world!", file.path(path, "test.txt")) 292s > 292s > ## add and commit 292s > add(repo, "test.txt") 292s > commit_1 <- commit(repo, "Commit message") 292s > 292s > ## Check that reflog is not empry 292s > stopifnot(identical(length(reflog(repo)), 1L)) 292s > reflog_entry <- reflog(repo)[[1]] 292s > stopifnot(identical(sha(reflog_entry), sha(commit_1))) 292s > stopifnot(identical(reflog_entry$refname, "HEAD")) 292s > stopifnot(identical(reflog_entry$index, 0L)) 292s > stopifnot(identical(reflog_entry$committer$email, "alice@example.org")) 292s > stopifnot(identical(reflog_entry$message, "commit (initial): Commit message")) 292s > 292s > ## Check printing 292s > r <- reflog(repo) 292s > stopifnot(identical(print(r), r)) 292s [6b4b574] HEAD@{0}: commit (initial): Commit message 292s > 292s > ## Cleanup 292s > unlink(path, recursive = TRUE) 292s > 292s BEGIN TEST refspec.R 292s 292s R version 4.4.3 (2025-02-28) -- "Trophy Case" 292s Copyright (C) 2025 The R Foundation for Statistical Computing 292s Platform: arm-unknown-linux-gnueabihf (32-bit) 292s 292s R is free software and comes with ABSOLUTELY NO WARRANTY. 292s You are welcome to redistribute it under certain conditions. 292s Type 'license()' or 'licence()' for distribution details. 292s 292s R is a collaborative project with many contributors. 292s Type 'contributors()' for more information and 292s 'citation()' on how to cite R or R packages in publications. 292s 292s Type 'demo()' for some demos, 'help()' for on-line help, or 292s 'help.start()' for an HTML browser interface to help. 292s Type 'q()' to quit R. 292s 292s > ## git2r, R bindings to the libgit2 library. 292s > ## Copyright (C) 2013-2023 The git2r contributors 292s > ## 292s > ## This program is free software; you can redistribute it and/or modify 292s > ## it under the terms of the GNU General Public License, version 2, 292s > ## as published by the Free Software Foundation. 292s > ## 292s > ## git2r is distributed in the hope that it will be useful, 292s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 292s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 292s > ## GNU General Public License for more details. 292s > ## 292s > ## You should have received a copy of the GNU General Public License along 292s > ## with this program; if not, write to the Free Software Foundation, Inc., 292s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 292s > 292s > library("git2r") 293s > 293s > ## For debugging 293s > sessionInfo() 293s R version 4.4.3 (2025-02-28) 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s Running under: Ubuntu Plucky Puffin (development branch) 293s 293s Matrix products: default 293s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 293s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 293s 293s locale: 293s [1] C 293s 293s time zone: Etc/UTC 293s tzcode source: system (glibc) 293s 293s attached base packages: 293s [1] stats graphics grDevices utils datasets methods base 293s 293s other attached packages: 293s [1] git2r_0.35.0 293s 293s loaded via a namespace (and not attached): 293s [1] compiler_4.4.3 293s > libgit2_version() 293s $major 293s [1] 1 293s 293s $minor 293s [1] 9 293s 293s $rev 293s [1] 0 293s 293s > libgit2_features() 293s $threads 293s [1] TRUE 293s 293s $https 293s [1] TRUE 293s 293s $ssh 293s [1] TRUE 293s 293s > 293s > 293s > ## Create directories for repositories in tempdir 293s > path_bare <- tempfile(pattern = "git2r-") 293s > path_repo <- tempfile(pattern = "git2r-") 293s > 293s > dir.create(path_bare) 293s > dir.create(path_repo) 293s > 293s > ## Create bare repository 293s > bare_repo <- init(path_bare, bare = TRUE) 293s > 293s > ## Clone to repo 293s > repo <- clone(path_bare, path_repo) 293s cloning into '/tmp/RtmpnJ9KkU/git2r-89e730d3d94'... 293s > config(repo, user.name = "Alice", user.email = "alice@example.org") 293s > 293s > ## Add changes to repo 293s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 293s + con = file.path(path_repo, "test.txt")) 293s > add(repo, "test.txt") 293s > commit_1 <- commit(repo, "First commit message") 293s > 293s > ## Add more changes to repo 293s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 293s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 293s + con = file.path(path_repo, "test.txt")) 293s > add(repo, "test.txt") 293s > commit_2 <- commit(repo, "Second commit message") 293s > 293s > ## Check remote 293s > stopifnot(identical( 293s + git2r:::get_refspec(repo, spec = "master")$remote, 293s + "origin")) 293s > 293s > ## Detach 293s > checkout(commit_1) 293s > tools::assertError(git2r:::get_refspec(repo)) 293s > 293s > ## Cleanup 293s > unlink(path_bare, recursive = TRUE) 293s > unlink(path_repo, recursive = TRUE) 293s > 293s BEGIN TEST remotes.R 293s 293s R version 4.4.3 (2025-02-28) -- "Trophy Case" 293s Copyright (C) 2025 The R Foundation for Statistical Computing 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s 293s R is free software and comes with ABSOLUTELY NO WARRANTY. 293s You are welcome to redistribute it under certain conditions. 293s Type 'license()' or 'licence()' for distribution details. 293s 293s R is a collaborative project with many contributors. 293s Type 'contributors()' for more information and 293s 'citation()' on how to cite R or R packages in publications. 293s 293s Type 'demo()' for some demos, 'help()' for on-line help, or 293s 'help.start()' for an HTML browser interface to help. 293s Type 'q()' to quit R. 293s 293s > ## git2r, R bindings to the libgit2 library. 293s > ## Copyright (C) 2013-2023 The git2r contributors 293s > ## 293s > ## This program is free software; you can redistribute it and/or modify 293s > ## it under the terms of the GNU General Public License, version 2, 293s > ## as published by the Free Software Foundation. 293s > ## 293s > ## git2r is distributed in the hope that it will be useful, 293s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 293s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 293s > ## GNU General Public License for more details. 293s > ## 293s > ## You should have received a copy of the GNU General Public License along 293s > ## with this program; if not, write to the Free Software Foundation, Inc., 293s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 293s > 293s > library("git2r") 293s > 293s > ## For debugging 293s > sessionInfo() 293s R version 4.4.3 (2025-02-28) 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s Running under: Ubuntu Plucky Puffin (development branch) 293s 293s Matrix products: default 293s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 293s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 293s 293s locale: 293s [1] C 293s 293s time zone: Etc/UTC 293s tzcode source: system (glibc) 293s 293s attached base packages: 293s [1] stats graphics grDevices utils datasets methods base 293s 293s other attached packages: 293s [1] git2r_0.35.0 293s 293s loaded via a namespace (and not attached): 293s [1] compiler_4.4.3 293s > libgit2_version() 293s $major 293s [1] 1 293s 293s $minor 293s [1] 9 293s 293s $rev 293s [1] 0 293s 293s > libgit2_features() 293s $threads 293s [1] TRUE 293s 293s $https 293s [1] TRUE 293s 293s $ssh 293s [1] TRUE 293s 293s > 293s > 293s > ## Create a directory in tempdir 293s > path <- tempfile(pattern = "git2r-") 293s > dir.create(path) 293s > 293s > ## Initialize a repository 293s > repo <- init(path) 293s > config(repo, user.name = "Alice", user.email = "alice@example.org") 293s > 293s > ## Create a file 293s > writeLines("Hello world!", file.path(path, "test.txt")) 293s > 293s > ## Add and commit 293s > add(repo, "test.txt") 293s > commit_1 <- commit(repo, "Commit message") 293s > 293s > ## Add a remote 293s > remote_add(repo, "playground", 293s + "https://github.com/gaborcsardi/playground") 293s > 293s > stopifnot(identical(remotes(repo), "playground")) 293s > stopifnot(identical(remote_url(repo, "playground"), 293s + "https://github.com/gaborcsardi/playground")) 293s > stopifnot(identical(remote_url(repo), 293s + "https://github.com/gaborcsardi/playground")) 293s > 293s > ## Rename a remote 293s > remote_rename(repo, "playground", "foobar") 293s > 293s > stopifnot(identical(remotes(repo), "foobar")) 293s > stopifnot(identical(remote_url(repo, "foobar"), 293s + "https://github.com/gaborcsardi/playground")) 293s > 293s > ## Set remote url 293s > remote_set_url(repo, "foobar", "https://github.com/stewid/playground") 293s > stopifnot(identical(remote_url(repo, "foobar"), 293s + "https://github.com/stewid/playground")) 293s > 293s > ## Remove a remote 293s > remote_remove(repo, "foobar") 293s > 293s > stopifnot(identical(remotes(repo), character(0))) 293s > 293s > if (identical(Sys.getenv("NOT_CRAN"), "true")) { 293s + if (isTRUE(libgit2_features()$https)) { 293s + refs <- remote_ls("https://github.com/ropensci/git2r") 293s + stopifnot(length(refs) > 0) 293s + stopifnot(names(refs) > 0) 293s + stopifnot(any(names(refs) == "HEAD")) 293s + } 293s + } 293s > 293s > # an invalid URL should throw an error 293s > tools::assertError(remote_ls("bad")) 293s > 293s > ## Cleanup 293s > unlink(path, recursive = TRUE) 293s > 293s BEGIN TEST remove.R 293s 293s R version 4.4.3 (2025-02-28) -- "Trophy Case" 293s Copyright (C) 2025 The R Foundation for Statistical Computing 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s 293s R is free software and comes with ABSOLUTELY NO WARRANTY. 293s You are welcome to redistribute it under certain conditions. 293s Type 'license()' or 'licence()' for distribution details. 293s 293s R is a collaborative project with many contributors. 293s Type 'contributors()' for more information and 293s 'citation()' on how to cite R or R packages in publications. 293s 293s Type 'demo()' for some demos, 'help()' for on-line help, or 293s 'help.start()' for an HTML browser interface to help. 293s Type 'q()' to quit R. 293s 293s > ## git2r, R bindings to the libgit2 library. 293s > ## Copyright (C) 2013-2023 The git2r contributors 293s > ## 293s > ## This program is free software; you can redistribute it and/or modify 293s > ## it under the terms of the GNU General Public License, version 2, 293s > ## as published by the Free Software Foundation. 293s > ## 293s > ## git2r is distributed in the hope that it will be useful, 293s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 293s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 293s > ## GNU General Public License for more details. 293s > ## 293s > ## You should have received a copy of the GNU General Public License along 293s > ## with this program; if not, write to the Free Software Foundation, Inc., 293s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 293s > 293s > library("git2r") 293s > 293s > ## For debugging 293s > sessionInfo() 293s R version 4.4.3 (2025-02-28) 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s Running under: Ubuntu Plucky Puffin (development branch) 293s 293s Matrix products: default 293s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 293s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 293s 293s locale: 293s [1] C 293s 293s time zone: Etc/UTC 293s tzcode source: system (glibc) 293s 293s attached base packages: 293s [1] stats graphics grDevices utils datasets methods base 293s 293s other attached packages: 293s [1] git2r_0.35.0 293s 293s loaded via a namespace (and not attached): 293s [1] compiler_4.4.3 293s > libgit2_version() 293s $major 293s [1] 1 293s 293s $minor 293s [1] 9 293s 293s $rev 293s [1] 0 293s 293s > libgit2_features() 293s $threads 293s [1] TRUE 293s 293s $https 293s [1] TRUE 293s 293s $ssh 293s [1] TRUE 293s 293s > 293s > 293s > ## Create a directory in tempdir 293s > path <- tempfile(pattern = "git2r-") 293s > dir.create(path) 293s > 293s > ## Initialize a repository 293s > repo <- init(path) 293s > config(repo, user.name = "Alice", user.email = "alice@example.org") 293s > 293s > ## Add files 293s > invisible(lapply(file.path(path, letters[1:4]), writeLines, text = "")) 293s > add(repo, letters) 293s > commit(repo, "init") 293s [d23adf3] 2025-03-15: init 293s > 293s > ## Remove one file 293s > rm_file(repo, letters[1]) 293s > commit(repo, "remove") 293s [5f85b9a] 2025-03-15: remove 293s > 293s > ## Remove two files. Don't raise warnings 293s > withCallingHandlers(rm_file(repo, letters[2:3]), warning = function(w) stop(w)) 293s > 293s > ## Remove one file using the absolute path to the file. 293s > rm_file(repo, file.path(path, letters[4])) 293s > 293s > ## Cleanup 293s > unlink(path, recursive = TRUE) 293s > 293s BEGIN TEST repository.R 293s 293s R version 4.4.3 (2025-02-28) -- "Trophy Case" 293s Copyright (C) 2025 The R Foundation for Statistical Computing 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s 293s R is free software and comes with ABSOLUTELY NO WARRANTY. 293s You are welcome to redistribute it under certain conditions. 293s Type 'license()' or 'licence()' for distribution details. 293s 293s R is a collaborative project with many contributors. 293s Type 'contributors()' for more information and 293s 'citation()' on how to cite R or R packages in publications. 293s 293s Type 'demo()' for some demos, 'help()' for on-line help, or 293s 'help.start()' for an HTML browser interface to help. 293s Type 'q()' to quit R. 293s 293s > ## git2r, R bindings to the libgit2 library. 293s > ## Copyright (C) 2013-2023 The git2r contributors 293s > ## 293s > ## This program is free software; you can redistribute it and/or modify 293s > ## it under the terms of the GNU General Public License, version 2, 293s > ## as published by the Free Software Foundation. 293s > ## 293s > ## git2r is distributed in the hope that it will be useful, 293s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 293s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 293s > ## GNU General Public License for more details. 293s > ## 293s > ## You should have received a copy of the GNU General Public License along 293s > ## with this program; if not, write to the Free Software Foundation, Inc., 293s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 293s > 293s > library(git2r) 293s > source("util/check.R") 293s > 293s > ## For debugging 293s > sessionInfo() 293s R version 4.4.3 (2025-02-28) 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s Running under: Ubuntu Plucky Puffin (development branch) 293s 293s Matrix products: default 293s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 293s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 293s 293s locale: 293s [1] C 293s 293s time zone: Etc/UTC 293s tzcode source: system (glibc) 293s 293s attached base packages: 293s [1] stats graphics grDevices utils datasets methods base 293s 293s other attached packages: 293s [1] git2r_0.35.0 293s 293s loaded via a namespace (and not attached): 293s [1] compiler_4.4.3 293s > libgit2_version() 293s $major 293s [1] 1 293s 293s $minor 293s [1] 9 293s 293s $rev 293s [1] 0 293s 293s > libgit2_features() 293s $threads 293s [1] TRUE 293s 293s $https 293s [1] TRUE 293s 293s $ssh 293s [1] TRUE 293s 293s > 293s > 293s > ## Create a directory in tempdir 293s > path <- tempfile(pattern = "git2r-") 293s > dir.create(path) 293s > 293s > ## is_bare: "Invalid repository" 293s > tools::assertError(is_bare(new("git_repository"))) 293s > 293s > ## is_empty: "Invalid repository" 293s > tools::assertError(is_empty(new("git_repository"))) 293s > 293s > ## Check that open an invalid repository fails 293s > tools::assertError(repository(path)) 293s > tools::assertError(repository(path, discover = FALSE)) 293s > 293s > ## Check that it fails to open/init a repository with a path to a 293s > ## file. 293s > writeLines("test", file.path(path, "test.txt")) 293s > tools::assertError(repository(file.path(path, "test.txt"), 293s + discover = FALSE)) 293s > tools::assertError(init(file.path(path, "test.txt"))) 293s > unlink(file.path(path, "test.txt")) 293s > 293s > ## Initialize a repository 293s > repo <- init(path) 293s > stopifnot(identical(print(repo), repo)) 293s Local: /tmp/Rtmp3WLGCk/git2r-8c26cde8d62 293s Head: nothing commited (yet) 293s > 293s > ## Check the state of the repository 293s > stopifnot(identical(is_bare(repo), FALSE)) 293s > stopifnot(identical(is_empty(repo), TRUE)) 293s > stopifnot(identical(is_shallow(repo), FALSE)) 293s > stopifnot(identical(branches(repo), empty_named_list())) 293s > stopifnot(identical(references(repo), empty_named_list())) 293s > stopifnot(identical(commits(repo), list())) 293s > stopifnot(identical(repository_head(repo), NULL)) 293s > 293s > # check that we can find repository from a path 293s > wd <- sub(paste0("[", .Platform$file.sep, "]$"), "", workdir(repo)) 293s > writeLines("test file", con = file.path(wd, "myfile.txt")) 293s > stopifnot(identical(discover_repository(file.path(wd, "myfile.txt")), 293s + file.path(wd, ".git"))) 293s > stopifnot(identical(discover_repository(file.path(wd, "doesntexist.txt")), 293s + NULL)) 293s > 293s > # Check that we can use ceiling in discover repostiory 293s > dir.create(file.path(wd, "temp")) 293s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 0), NULL)) 293s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 1), 293s + file.path(wd, ".git"))) 293s > tools::assertError(discover_repository(file.path(wd, "temp"), 2)) 293s > 293s > ## Check that lookup with a sha of less than 4 characters or more than 293s > ## 40 characters fail. 293s > tools::assertError(lookup(repo, paste0(rep("a", 3), collapse = ""))) 293s Warning message: 293s In normalizePath(path) : 293s path[1]="/tmp/Rtmp3WLGCk/git2r-8c26cde8d62/doesntexist.txt": No such file or directory 293s > tools::assertError(lookup(repo, paste0(rep("a", 41), collapse = ""))) 293s > 293s > ## Check in_repository 293s > stopifnot(identical(in_repository(path), TRUE)) 293s > 293s > ## Check: 293s > ## - in_repository method with missing path argument 293s > ## - repository method with missing path argument 293s > ## - workdir method with missing path argument 293s > ## - is_empty method with missing repo argument 293s > ## - is_shallow method with missing repo argument 293s > wd <- setwd(path) 293s > stopifnot(identical(in_repository(), TRUE)) 293s > stopifnot(identical(workdir(repository(path)), workdir(repository()))) 293s > stopifnot(identical(workdir(repository(path)), workdir())) 293s > stopifnot(identical(is_empty(), TRUE)) 293s > stopifnot(identical(is_shallow(), FALSE)) 293s > if (!is.null(wd)) 293s + setwd(wd) 293s > 293s > ## Cleanup 293s > unlink(path, recursive = TRUE) 293s > 293s BEGIN TEST reset.R 293s 293s R version 4.4.3 (2025-02-28) -- "Trophy Case" 293s Copyright (C) 2025 The R Foundation for Statistical Computing 293s Platform: arm-unknown-linux-gnueabihf (32-bit) 293s 293s R is free software and comes with ABSOLUTELY NO WARRANTY. 293s You are welcome to redistribute it under certain conditions. 293s Type 'license()' or 'licence()' for distribution details. 293s 293s R is a collaborative project with many contributors. 293s Type 'contributors()' for more information and 293s 'citation()' on how to cite R or R packages in publications. 293s 293s Type 'demo()' for some demos, 'help()' for on-line help, or 293s 'help.start()' for an HTML browser interface to help. 293s Type 'q()' to quit R. 293s 294s > ## git2r, R bindings to the libgit2 library. 294s > ## Copyright (C) 2013-2023 The git2r contributors 294s > ## 294s > ## This program is free software; you can redistribute it and/or modify 294s > ## it under the terms of the GNU General Public License, version 2, 294s > ## as published by the Free Software Foundation. 294s > ## 294s > ## git2r is distributed in the hope that it will be useful, 294s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 294s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 294s > ## GNU General Public License for more details. 294s > ## 294s > ## You should have received a copy of the GNU General Public License along 294s > ## with this program; if not, write to the Free Software Foundation, Inc., 294s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 294s > 294s > library(git2r) 294s > source("util/check.R") 294s > 294s > ## For debugging 294s > sessionInfo() 294s R version 4.4.3 (2025-02-28) 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s Running under: Ubuntu Plucky Puffin (development branch) 294s 294s Matrix products: default 294s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 294s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 294s 294s locale: 294s [1] C 294s 294s time zone: Etc/UTC 294s tzcode source: system (glibc) 294s 294s attached base packages: 294s [1] stats graphics grDevices utils datasets methods base 294s 294s other attached packages: 294s [1] git2r_0.35.0 294s 294s loaded via a namespace (and not attached): 294s [1] compiler_4.4.3 294s > libgit2_version() 294s $major 294s [1] 1 294s 294s $minor 294s [1] 9 294s 294s $rev 294s [1] 0 294s 294s > libgit2_features() 294s $threads 294s [1] TRUE 294s 294s $https 294s [1] TRUE 294s 294s $ssh 294s [1] TRUE 294s 294s > 294s > 294s > ## Create a directory in tempdir 294s > path <- tempfile(pattern = "git2r-") 294s > dir.create(path) 294s > 294s > ## Initialize a repository 294s > repo <- init(path) 294s > config(repo, user.name = "Alice", user.email = "alice@example.org") 294s > 294s > ## Create a file 294s > writeLines("Hello world!", file.path(path, "test-1.txt")) 294s > 294s > ## Add and reset an empty repository using a path 294s > add(repo, "test-1.txt") 294s > stopifnot(identical( 294s + status(repo), 294s + structure(list(staged = list(new = "test-1.txt"), 294s + unstaged = empty_named_list(), 294s + untracked = empty_named_list()), 294s + class = "git_status"))) 294s > reset(repo, path = "test-1.txt") 294s > stopifnot(identical( 294s + status(repo), 294s + structure(list(staged = empty_named_list(), 294s + unstaged = empty_named_list(), 294s + untracked = list(untracked = "test-1.txt")), 294s + class = "git_status"))) 294s > 294s > ## Add and reset a non-empty repository using a path 294s > add(repo, "test-1.txt") 294s > commit(repo, "First commit") 294s [ca637c9] 2025-03-15: First commit 294s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 294s > add(repo, "test-1.txt") 294s > stopifnot(identical( 294s + status(repo), 294s + structure(list(staged = list(modified = "test-1.txt"), 294s + unstaged = empty_named_list(), 294s + untracked = empty_named_list()), 294s + class = "git_status"))) 294s > reset(repo, path = "test-1.txt") 294s > stopifnot(identical( 294s + status(repo), 294s + structure(list(staged = empty_named_list(), 294s + unstaged = list(modified = "test-1.txt"), 294s + untracked = empty_named_list()), 294s + class = "git_status"))) 294s > 294s > ## add and commit 294s > add(repo, "test-1.txt") 294s > commit_1 <- commit(repo, "Commit message") 294s > 294s > ## Make one more commit 294s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 294s + file.path(path, "test-1.txt")) 294s > add(repo, "test-1.txt") 294s > commit(repo, "Next commit message") 294s [3b0798f] 2025-03-15: Next commit message 294s > 294s > ## Create one more file 294s > writeLines("Hello world!", file.path(path, "test-2.txt")) 294s > 294s > ## 'soft' reset to first commit 294s > reset(commit_1) 294s > soft_exp <- structure(list(staged = list(modified = "test-1.txt"), 294s + unstaged = empty_named_list(), 294s + untracked = list(untracked = "test-2.txt")), 294s + class = "git_status") 294s > soft_obs <- status(repo) 294s > stopifnot(identical(soft_obs, soft_exp)) 294s > stopifnot(identical(length(commits(repo)), 2L)) 294s > stopifnot(identical(commits(repo)[[1]], commit_1)) 294s > 294s > ## 'mixed' reset to first commit 294s > commit(repo, "Next commit message") 294s [3b0798f] 2025-03-15: Next commit message 294s > reset(commit_1, "mixed") 294s > mixed_exp <- structure(list(staged = empty_named_list(), 294s + unstaged = list(modified = "test-1.txt"), 294s + untracked = list(untracked = "test-2.txt")), 294s + class = "git_status") 294s > mixed_obs <- status(repo) 294s > stopifnot(identical(mixed_obs, mixed_exp)) 294s > stopifnot(identical(length(commits(repo)), 2L)) 294s > stopifnot(identical(commits(repo)[[1]], commit_1)) 294s > 294s > ## 'hard' reset to first commit 294s > add(repo, "test-1.txt") 294s > commit(repo, "Next commit message") 294s [3b0798f] 2025-03-15: Next commit message 294s > reset(commit_1, "hard") 294s > hard_exp <- structure(list(staged = empty_named_list(), 294s + unstaged = empty_named_list(), 294s + untracked = list(untracked = "test-2.txt")), 294s + class = "git_status") 294s > hard_obs <- status(repo) 294s > stopifnot(identical(hard_obs, hard_exp)) 294s > stopifnot(identical(length(commits(repo)), 2L)) 294s > stopifnot(identical(commits(repo)[[1]], commit_1)) 294s > 294s > ## Cleanup 294s > unlink(path, recursive = TRUE) 294s > 294s BEGIN TEST revparse.R 294s 294s R version 4.4.3 (2025-02-28) -- "Trophy Case" 294s Copyright (C) 2025 The R Foundation for Statistical Computing 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s 294s R is free software and comes with ABSOLUTELY NO WARRANTY. 294s You are welcome to redistribute it under certain conditions. 294s Type 'license()' or 'licence()' for distribution details. 294s 294s R is a collaborative project with many contributors. 294s Type 'contributors()' for more information and 294s 'citation()' on how to cite R or R packages in publications. 294s 294s Type 'demo()' for some demos, 'help()' for on-line help, or 294s 'help.start()' for an HTML browser interface to help. 294s Type 'q()' to quit R. 294s 294s > ## git2r, R bindings to the libgit2 library. 294s > ## Copyright (C) 2013-2023 The git2r contributors 294s > ## 294s > ## This program is free software; you can redistribute it and/or modify 294s > ## it under the terms of the GNU General Public License, version 2, 294s > ## as published by the Free Software Foundation. 294s > ## 294s > ## git2r is distributed in the hope that it will be useful, 294s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 294s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 294s > ## GNU General Public License for more details. 294s > ## 294s > ## You should have received a copy of the GNU General Public License along 294s > ## with this program; if not, write to the Free Software Foundation, Inc., 294s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 294s > 294s > library("git2r") 294s > 294s > ## For debugging 294s > sessionInfo() 294s R version 4.4.3 (2025-02-28) 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s Running under: Ubuntu Plucky Puffin (development branch) 294s 294s Matrix products: default 294s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 294s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 294s 294s locale: 294s [1] C 294s 294s time zone: Etc/UTC 294s tzcode source: system (glibc) 294s 294s attached base packages: 294s [1] stats graphics grDevices utils datasets methods base 294s 294s other attached packages: 294s [1] git2r_0.35.0 294s 294s loaded via a namespace (and not attached): 294s [1] compiler_4.4.3 294s > libgit2_version() 294s $major 294s [1] 1 294s 294s $minor 294s [1] 9 294s 294s $rev 294s [1] 0 294s 294s > libgit2_features() 294s $threads 294s [1] TRUE 294s 294s $https 294s [1] TRUE 294s 294s $ssh 294s [1] TRUE 294s 294s > 294s > 294s > ## Create a directory in tempdir 294s > path <- tempfile(pattern = "git2r-") 294s > dir.create(path) 294s > 294s > ## Initialize a repository 294s > repo <- init(path) 294s > config(repo, user.name = "Alice", user.email = "alice@example.org") 294s > 294s > ## Create a file 294s > writeLines("Hello world!", file.path(path, "test.txt")) 294s > 294s > ## Add and commit 294s > add(repo, "test.txt") 294s > commit_1 <- commit(repo, "First commit message") 294s > 294s > tools::assertError(revparse_single(repo, "HEAD^")) 294s > 294s > ## Add another commit 294s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 294s > add(repo, "test.txt") 294s > commit(repo, "Second commit message") 294s [e685246] 2025-03-15: Second commit message 294s > 294s > stopifnot(identical(revparse_single(repo, "HEAD^"), commit_1)) 294s > stopifnot(is_blob(revparse_single(repo, "HEAD:test.txt"))) 294s > 294s > ## Cleanup 294s > unlink(path, recursive = TRUE) 294s > 294s BEGIN TEST signature.R 294s 294s R version 4.4.3 (2025-02-28) -- "Trophy Case" 294s Copyright (C) 2025 The R Foundation for Statistical Computing 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s 294s R is free software and comes with ABSOLUTELY NO WARRANTY. 294s You are welcome to redistribute it under certain conditions. 294s Type 'license()' or 'licence()' for distribution details. 294s 294s R is a collaborative project with many contributors. 294s Type 'contributors()' for more information and 294s 'citation()' on how to cite R or R packages in publications. 294s 294s Type 'demo()' for some demos, 'help()' for on-line help, or 294s 'help.start()' for an HTML browser interface to help. 294s Type 'q()' to quit R. 294s 294s > ## git2r, R bindings to the libgit2 library. 294s > ## Copyright (C) 2013-2023 The git2r contributors 294s > ## 294s > ## This program is free software; you can redistribute it and/or modify 294s > ## it under the terms of the GNU General Public License, version 2, 294s > ## as published by the Free Software Foundation. 294s > ## 294s > ## git2r is distributed in the hope that it will be useful, 294s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 294s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 294s > ## GNU General Public License for more details. 294s > ## 294s > ## You should have received a copy of the GNU General Public License along 294s > ## with this program; if not, write to the Free Software Foundation, Inc., 294s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 294s > 294s > library("git2r") 294s > 294s > ## For debugging 294s > sessionInfo() 294s R version 4.4.3 (2025-02-28) 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s Running under: Ubuntu Plucky Puffin (development branch) 294s 294s Matrix products: default 294s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 294s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 294s 294s locale: 294s [1] C 294s 294s time zone: Etc/UTC 294s tzcode source: system (glibc) 294s 294s attached base packages: 294s [1] stats graphics grDevices utils datasets methods base 294s 294s other attached packages: 294s [1] git2r_0.35.0 294s 294s loaded via a namespace (and not attached): 294s [1] compiler_4.4.3 294s > libgit2_version() 294s $major 294s [1] 1 294s 294s $minor 294s [1] 9 294s 294s $rev 294s [1] 0 294s 294s > libgit2_features() 294s $threads 294s [1] TRUE 294s 294s $https 294s [1] TRUE 294s 294s $ssh 294s [1] TRUE 294s 294s > 294s > 294s > ## Check printing of a class git_signature 294s > when <- structure(list(time = 1395567947, offset = 60), 294s + class = "git_time") 294s > 294s > signature <- structure(list(name = "Alice", 294s + email = "alice@example.org", 294s + when = when), 294s + class = "git_signature") 294s > stopifnot(identical(print(signature), signature)) 294s name: Alice 294s email: alice@example.org 294s when: 2014-03-23 09:45:47 GMT 294s > 294s BEGIN TEST stash.R 294s 294s R version 4.4.3 (2025-02-28) -- "Trophy Case" 294s Copyright (C) 2025 The R Foundation for Statistical Computing 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s 294s R is free software and comes with ABSOLUTELY NO WARRANTY. 294s You are welcome to redistribute it under certain conditions. 294s Type 'license()' or 'licence()' for distribution details. 294s 294s R is a collaborative project with many contributors. 294s Type 'contributors()' for more information and 294s 'citation()' on how to cite R or R packages in publications. 294s 294s Type 'demo()' for some demos, 'help()' for on-line help, or 294s 'help.start()' for an HTML browser interface to help. 294s Type 'q()' to quit R. 294s 294s > ## git2r, R bindings to the libgit2 library. 294s > ## Copyright (C) 2013-2023 The git2r contributors 294s > ## 294s > ## This program is free software; you can redistribute it and/or modify 294s > ## it under the terms of the GNU General Public License, version 2, 294s > ## as published by the Free Software Foundation. 294s > ## 294s > ## git2r is distributed in the hope that it will be useful, 294s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 294s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 294s > ## GNU General Public License for more details. 294s > ## 294s > ## You should have received a copy of the GNU General Public License along 294s > ## with this program; if not, write to the Free Software Foundation, Inc., 294s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 294s > 294s > library("git2r") 294s > 294s > ## For debugging 294s > sessionInfo() 294s R version 4.4.3 (2025-02-28) 294s Platform: arm-unknown-linux-gnueabihf (32-bit) 294s Running under: Ubuntu Plucky Puffin (development branch) 294s 294s Matrix products: default 294s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 294s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 294s 294s locale: 294s [1] C 294s 294s time zone: Etc/UTC 294s tzcode source: system (glibc) 294s 294s attached base packages: 294s [1] stats graphics grDevices utils datasets methods base 294s 294s other attached packages: 294s [1] git2r_0.35.0 294s 294s loaded via a namespace (and not attached): 294s [1] compiler_4.4.3 294s > libgit2_version() 294s $major 294s [1] 1 294s 294s $minor 294s [1] 9 294s 294s $rev 294s [1] 0 294s 294s > libgit2_features() 294s $threads 294s [1] TRUE 294s 294s $https 294s [1] TRUE 294s 294s $ssh 294s [1] TRUE 294s 294s > 294s > 294s > ## Create a directory in tempdir 294s > path <- tempfile(pattern = "git2r-") 294s > dir.create(path) 294s > 294s > ## Initialize a repository 294s > repo <- init(path) 294s > config(repo, user.name = "Alice", user.email = "alice@example.org") 294s > 294s > ## Create a file 294s > writeLines("Hello world!", file.path(path, "test-1.txt")) 294s > 294s > ## add and commit 294s > add(repo, "test-1.txt") 294s > commit(repo, "Commit message") 294s [ea50328] 2025-03-15: Commit message 294s > 294s > ## Pop stash 294s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 294s > stash(repo) 294s > stopifnot(identical("Hello world!", 294s + readLines(file.path(path, "test-1.txt")))) 294s > stash_pop(repo) 294s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 294s + readLines(file.path(path, "test-1.txt")))) 294s > 294s > ## Make one more commit 294s > add(repo, "test-1.txt") 294s > commit(repo, "Next commit message") 294s [2dc5a1b] 2025-03-15: Next commit message 294s > 294s > ## Check that there are no stashes 294s > stopifnot(identical(stash_list(repo), list())) 294s > 294s > ## Apply stash 294s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 294s + file.path(path, "test-1.txt")) 294s > stash(repo) 294s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 294s + readLines(file.path(path, "test-1.txt")))) 294s > stash_apply(repo) 294s > stopifnot(identical(c("Hello world!", "HELLO WORLD!", "hello world!"), 294s + readLines(file.path(path, "test-1.txt")))) 294s > stopifnot(identical(length(stash_list(repo)), 1L)) 294s > stash_drop(repo, 1) 294s > stopifnot(identical(stash_list(repo), list())) 294s > 294s > ## Make one more commit 294s > add(repo, "test-1.txt") 294s > commit(repo, "Apply stash commit message") 294s [6de1dc5] 2025-03-15: Apply stash commit message 294s > 294s > ## Create one more file 294s > writeLines("Hello world!", file.path(path, "test-2.txt")) 294s > 294s > ## Check that there are no stashes 294s > stopifnot(identical(stash_list(repo), list())) 294s > 294s > ## Stash 294s > stash(repo) 294s > stopifnot(identical(stash_list(repo), list())) 294s > s <- stash(repo, untracked = TRUE) 294s > stopifnot(identical(print(s), s)) 294s On master: 2025-03-15 16:15:23.948293 294s 294s > summary(s) 294s message: On master: 2025-03-15 16:15:23.948293 294s stasher: Alice 294s when: 2025-03-15 16:15:23 GMT 294s sha: 1241d3bdf4b50bb1029e4b9b1ca26f51267a996d 294s 294s > stopifnot(identical(length(stash_list(repo)), 1L)) 294s > tree(stash_list(repo)[[1]]) 294s tree: af5711badde07055d853088e98c6d988bfdd139f 294s 294s mode type sha name 294s 1 100644 blob 5b168e5ff4e9eeff020b99a3c1c83c4979294e76 test-1.txt 294s > 294s > ## Drop stash 294s > stash_drop(repo, 1) 294s > stopifnot(identical(stash_list(repo), list())) 294s > 294s > ## Check stash_drop argument 294s > tools::assertError(stash_drop(repo)) 295s > tools::assertError(stash_drop(repo, -1)) 295s > tools::assertError(stash_drop(repo, 0.5)) 295s > 295s > ## Create one more file 295s > writeLines("Hello world!", file.path(path, "test-3.txt")) 295s > 295s > ## Create stash in repository 295s > stash(repo, untracked = TRUE) 295s > stopifnot(identical(length(stash_list(repo)), 1L)) 295s > 295s > ## Check stash_list method with missing repo argument 295s > wd <- setwd(path) 295s > stopifnot(identical(length(stash_list()), 1L)) 295s > if (!is.null(wd)) 295s + setwd(wd) 295s > 295s > ## Drop git_stash object in repository 295s > stash_drop(stash_list(repo)[[1]]) 295s > 295s > ## Cleanup 295s > unlink(path, recursive = TRUE) 295s > 295s BEGIN TEST status.R 295s 295s R version 4.4.3 (2025-02-28) -- "Trophy Case" 295s Copyright (C) 2025 The R Foundation for Statistical Computing 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s 295s R is free software and comes with ABSOLUTELY NO WARRANTY. 295s You are welcome to redistribute it under certain conditions. 295s Type 'license()' or 'licence()' for distribution details. 295s 295s R is a collaborative project with many contributors. 295s Type 'contributors()' for more information and 295s 'citation()' on how to cite R or R packages in publications. 295s 295s Type 'demo()' for some demos, 'help()' for on-line help, or 295s 'help.start()' for an HTML browser interface to help. 295s Type 'q()' to quit R. 295s 295s > ## git2r, R bindings to the libgit2 library. 295s > ## Copyright (C) 2013-2023 The git2r contributors 295s > ## 295s > ## This program is free software; you can redistribute it and/or modify 295s > ## it under the terms of the GNU General Public License, version 2, 295s > ## as published by the Free Software Foundation. 295s > ## 295s > ## git2r is distributed in the hope that it will be useful, 295s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 295s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 295s > ## GNU General Public License for more details. 295s > ## 295s > ## You should have received a copy of the GNU General Public License along 295s > ## with this program; if not, write to the Free Software Foundation, Inc., 295s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 295s > 295s > library(git2r) 295s > source("util/check.R") 295s > 295s > ## For debugging 295s > sessionInfo() 295s R version 4.4.3 (2025-02-28) 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s Running under: Ubuntu Plucky Puffin (development branch) 295s 295s Matrix products: default 295s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 295s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 295s 295s locale: 295s [1] C 295s 295s time zone: Etc/UTC 295s tzcode source: system (glibc) 295s 295s attached base packages: 295s [1] stats graphics grDevices utils datasets methods base 295s 295s other attached packages: 295s [1] git2r_0.35.0 295s 295s loaded via a namespace (and not attached): 295s [1] compiler_4.4.3 295s > libgit2_version() 295s $major 295s [1] 1 295s 295s $minor 295s [1] 9 295s 295s $rev 295s [1] 0 295s 295s > libgit2_features() 295s $threads 295s [1] TRUE 295s 295s $https 295s [1] TRUE 295s 295s $ssh 295s [1] TRUE 295s 295s > 295s > 295s > ## Create a directory in tempdir 295s > path <- tempfile(pattern = "git2r-") 295s > dir.create(path) 295s > 295s > ## Initialize a repository 295s > repo <- init(path) 295s > config(repo, user.name = "Alice", user.email = "alice@example.org") 295s > 295s > ## Status case 1 295s > status_exp_1 <- structure(list(staged = empty_named_list(), 295s + unstaged = empty_named_list(), 295s + untracked = empty_named_list()), 295s + class = "git_status") 295s > status_obs_1 <- status(repo) 295s > stopifnot(identical(print(status_obs_1), status_obs_1)) 295s working directory clean 295s > str(status_exp_1) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked: Named list() 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_1) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked: Named list() 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_1, status_exp_1)) 295s > stopifnot(identical(capture.output(status(repo)), 295s + "working directory clean")) 295s > 295s > ## Status case 2, include ignored files 295s > status_exp_2 <- structure(list(staged = empty_named_list(), 295s + unstaged = empty_named_list(), 295s + untracked = empty_named_list(), 295s + ignored = empty_named_list()), 295s + class = "git_status") 295s > status_obs_2 <- status(repo, ignored = TRUE) 295s > status_obs_2 295s working directory clean 295s > str(status_exp_2) 295s List of 4 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked: Named list() 295s $ ignored : Named list() 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_2) 295s List of 4 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked: Named list() 295s $ ignored : Named list() 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_2, status_exp_2)) 295s > stopifnot(identical(capture.output(status(repo, ignored = TRUE)), 295s + "working directory clean")) 295s > 295s > ## Create 4 files 295s > writeLines("File-1", file.path(path, "test-1.txt")) 295s > writeLines("File-2", file.path(path, "test-2.txt")) 295s > writeLines("File-3", file.path(path, "test-3.txt")) 295s > writeLines("File-4", file.path(path, "test-4.txt")) 295s > 295s > ## Status case 3: 4 untracked files 295s > status_exp_3 <- structure(list(staged = empty_named_list(), 295s + unstaged = empty_named_list(), 295s + untracked = list(untracked = "test-1.txt", 295s + untracked = "test-2.txt", 295s + untracked = "test-3.txt", 295s + untracked = "test-4.txt")), 295s + class = "git_status") 295s > status_obs_3 <- status(repo) 295s > status_obs_3 295s Untracked files: 295s Untracked: test-1.txt 295s Untracked: test-2.txt 295s Untracked: test-3.txt 295s Untracked: test-4.txt 295s 295s > str(status_exp_3) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked:List of 4 295s ..$ untracked: chr "test-1.txt" 295s ..$ untracked: chr "test-2.txt" 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_3) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked:List of 4 295s ..$ untracked: chr "test-1.txt" 295s ..$ untracked: chr "test-2.txt" 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_3, status_exp_3)) 295s > 295s > ## Add file 1 and 2 to the repository and commit 295s > add(repo, c("test-1.txt", "test-2.txt")) 295s > commit(repo, "Commit message") 295s [dee0155] 2025-03-15: Commit message 295s > 295s > ## Status case 4: 2 untracked files 295s > status_exp_4 <- structure(list(staged = empty_named_list(), 295s + unstaged = empty_named_list(), 295s + untracked = list(untracked = "test-3.txt", 295s + untracked = "test-4.txt")), 295s + class = "git_status") 295s > status_obs_4 <- status(repo) 295s > status_obs_4 295s Untracked files: 295s Untracked: test-3.txt 295s Untracked: test-4.txt 295s 295s > str(status_exp_4) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked:List of 2 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_4) 295s List of 3 295s $ staged : Named list() 295s $ unstaged : Named list() 295s $ untracked:List of 2 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_4, status_exp_4)) 295s > 295s > ## Update file 1 & 2 295s > writeLines(c("File-1", "Hello world"), file.path(path, "test-1.txt")) 295s > writeLines(c("File-2", "Hello world"), file.path(path, "test-2.txt")) 295s > 295s > ## Add file 1 295s > add(repo, "test-1.txt") 295s > 295s > ## Status case 5: 1 staged file, 1 unstaged file and 2 untracked files 295s > status_exp_5 <- structure(list(staged = list(modified = "test-1.txt"), 295s + unstaged = list(modified = "test-2.txt"), 295s + untracked = list(untracked = "test-3.txt", 295s + untracked = "test-4.txt")), 295s + class = "git_status") 295s > status_obs_5 <- status(repo) 295s > status_obs_5 295s Untracked files: 295s Untracked: test-3.txt 295s Untracked: test-4.txt 295s 295s Unstaged changes: 295s Modified: test-2.txt 295s 295s Staged changes: 295s Modified: test-1.txt 295s 295s > str(status_exp_5) 295s List of 3 295s $ staged :List of 1 295s ..$ modified: chr "test-1.txt" 295s $ unstaged :List of 1 295s ..$ modified: chr "test-2.txt" 295s $ untracked:List of 2 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_5) 295s List of 3 295s $ staged :List of 1 295s ..$ modified: chr "test-1.txt" 295s $ unstaged :List of 1 295s ..$ modified: chr "test-2.txt" 295s $ untracked:List of 2 295s ..$ untracked: chr "test-3.txt" 295s ..$ untracked: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_5, status_exp_5)) 295s > 295s > ## Add .gitignore file with file test-4.txt 295s > writeLines("test-4.txt", file.path(path, ".gitignore")) 295s > 295s > ## Status case 6: 1 staged file, 1 unstaged file, 2 untracked files 295s > ## and 1 ignored file 295s > status_exp_6 <- structure(list(staged = list(modified = "test-1.txt"), 295s + unstaged = list(modified = "test-2.txt"), 295s + untracked = list(untracked = ".gitignore", 295s + untracked = "test-3.txt"), 295s + ignored = list(ignored = "test-4.txt")), 295s + class = "git_status") 295s > status_obs_6 <- status(repo, ignore = TRUE) 295s > status_obs_6 295s Ignored files: 295s Ignored: test-4.txt 295s 295s Untracked files: 295s Untracked: .gitignore 295s Untracked: test-3.txt 295s 295s Unstaged changes: 295s Modified: test-2.txt 295s 295s Staged changes: 295s Modified: test-1.txt 295s 295s > str(status_exp_6) 295s List of 4 295s $ staged :List of 1 295s ..$ modified: chr "test-1.txt" 295s $ unstaged :List of 1 295s ..$ modified: chr "test-2.txt" 295s $ untracked:List of 2 295s ..$ untracked: chr ".gitignore" 295s ..$ untracked: chr "test-3.txt" 295s $ ignored :List of 1 295s ..$ ignored: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > str(status_obs_6) 295s List of 4 295s $ staged :List of 1 295s ..$ modified: chr "test-1.txt" 295s $ unstaged :List of 1 295s ..$ modified: chr "test-2.txt" 295s $ untracked:List of 2 295s ..$ untracked: chr ".gitignore" 295s ..$ untracked: chr "test-3.txt" 295s $ ignored :List of 1 295s ..$ ignored: chr "test-4.txt" 295s - attr(*, "class")= chr "git_status" 295s > stopifnot(identical(status_obs_6, status_exp_6)) 295s > 295s > ## Cleanup 295s > unlink(path, recursive = TRUE) 295s > 295s BEGIN TEST tag.R 295s 295s R version 4.4.3 (2025-02-28) -- "Trophy Case" 295s Copyright (C) 2025 The R Foundation for Statistical Computing 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s 295s R is free software and comes with ABSOLUTELY NO WARRANTY. 295s You are welcome to redistribute it under certain conditions. 295s Type 'license()' or 'licence()' for distribution details. 295s 295s R is a collaborative project with many contributors. 295s Type 'contributors()' for more information and 295s 'citation()' on how to cite R or R packages in publications. 295s 295s Type 'demo()' for some demos, 'help()' for on-line help, or 295s 'help.start()' for an HTML browser interface to help. 295s Type 'q()' to quit R. 295s 295s > ## git2r, R bindings to the libgit2 library. 295s > ## Copyright (C) 2013-2023 The git2r contributors 295s > ## 295s > ## This program is free software; you can redistribute it and/or modify 295s > ## it under the terms of the GNU General Public License, version 2, 295s > ## as published by the Free Software Foundation. 295s > ## 295s > ## git2r is distributed in the hope that it will be useful, 295s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 295s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 295s > ## GNU General Public License for more details. 295s > ## 295s > ## You should have received a copy of the GNU General Public License along 295s > ## with this program; if not, write to the Free Software Foundation, Inc., 295s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 295s > 295s > library(git2r) 295s > source("util/check.R") 295s > 295s > ## For debugging 295s > sessionInfo() 295s R version 4.4.3 (2025-02-28) 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s Running under: Ubuntu Plucky Puffin (development branch) 295s 295s Matrix products: default 295s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 295s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 295s 295s locale: 295s [1] C 295s 295s time zone: Etc/UTC 295s tzcode source: system (glibc) 295s 295s attached base packages: 295s [1] stats graphics grDevices utils datasets methods base 295s 295s other attached packages: 295s [1] git2r_0.35.0 295s 295s loaded via a namespace (and not attached): 295s [1] compiler_4.4.3 295s > libgit2_version() 295s $major 295s [1] 1 295s 295s $minor 295s [1] 9 295s 295s $rev 295s [1] 0 295s 295s > libgit2_features() 295s $threads 295s [1] TRUE 295s 295s $https 295s [1] TRUE 295s 295s $ssh 295s [1] TRUE 295s 295s > 295s > 295s > ## Create a directory in tempdir 295s > path <- tempfile(pattern = "git2r-") 295s > dir.create(path) 295s > 295s > ## Initialize a repository 295s > repo <- init(path) 295s > config(repo, user.name = "Alice", user.email = "alice@example.org") 295s > 295s > ## Create a file 295s > writeLines("Hello world!", file.path(path, "test.txt")) 295s > 295s > ## add and commit 295s > add(repo, "test.txt") 295s > commit(repo, "Commit message") 295s [179972d] 2025-03-15: Commit message 295s > 295s > ## Check tags, no tag added 295s > stopifnot(identical(tags(repo), empty_named_list())) 295s > 295s > ## Create tag 295s > new_tag <- tag(repo, "Tagname", "Tag message") 295s > stopifnot(identical(print(new_tag), new_tag)) 295s [179972] Tagname 295s > summary(new_tag) 295s name: Tagname 295s target: 179972d1ce460ab28134fa0aea442cbf7fd5cae6 295s tagger: Alice 295s when: 2025-03-15 16:15:24 GMT 295s message: Tag message 295s > 295s > ## Check tag 295s > stopifnot(identical(lookup(repo, sha(new_tag)), new_tag)) 295s > stopifnot(identical(new_tag$name, "Tagname")) 295s > stopifnot(identical(new_tag$message, "Tag message")) 295s > stopifnot(identical(new_tag$tagger$name, "Alice")) 295s > stopifnot(identical(new_tag$tagger$email, "alice@example.org")) 295s > stopifnot(identical(length(tags(repo)), 1L)) 295s > stopifnot(identical(tags(repo)[[1]]$name, "Tagname")) 295s > stopifnot(identical(tags(repo)[[1]]$message, "Tag message")) 295s > stopifnot(identical(tags(repo)[[1]]$tagger$name, "Alice")) 295s > stopifnot(identical(tags(repo)[[1]]$tagger$email, "alice@example.org")) 295s > 295s > ## Check objects in object database 295s > stopifnot(identical(table(odb_objects(repo)$type), 295s + structure(c(1L, 1L, 1L, 1L), 295s + .Dim = 4L, 295s + .Dimnames = structure(list( 295s + c("blob", "commit", "tag", "tree")), 295s + .Names = ""), 295s + class = "table"))) 295s > 295s > ## Delete tag 295s > tag_delete(new_tag) 295s > stopifnot(identical(length(tags(repo)), 0L)) 295s > 295s > ## Create tag with session info 295s > tag(repo, "Tagname", "Tag message", session = TRUE) 295s > stopifnot(grep("git2r", tags(repo)[[1]]$message) > 0) 295s > 295s > ## Check tags method with default repo argument 295s > wd <- setwd(path) 295s > stopifnot(identical(length(tags()), 1L)) 295s > tag_delete(name = "Tagname") 295s > stopifnot(identical(length(tags()), 0L)) 295s > if (!is.null(wd)) 295s + setwd(wd) 295s > 295s > ## Cleanup 295s > unlink(path, recursive = TRUE) 295s > 295s BEGIN TEST time.R 295s 295s R version 4.4.3 (2025-02-28) -- "Trophy Case" 295s Copyright (C) 2025 The R Foundation for Statistical Computing 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s 295s R is free software and comes with ABSOLUTELY NO WARRANTY. 295s You are welcome to redistribute it under certain conditions. 295s Type 'license()' or 'licence()' for distribution details. 295s 295s R is a collaborative project with many contributors. 295s Type 'contributors()' for more information and 295s 'citation()' on how to cite R or R packages in publications. 295s 295s Type 'demo()' for some demos, 'help()' for on-line help, or 295s 'help.start()' for an HTML browser interface to help. 295s Type 'q()' to quit R. 295s 295s > ## git2r, R bindings to the libgit2 library. 295s > ## Copyright (C) 2013-2023 The git2r contributors 295s > ## 295s > ## This program is free software; you can redistribute it and/or modify 295s > ## it under the terms of the GNU General Public License, version 2, 295s > ## as published by the Free Software Foundation. 295s > ## 295s > ## git2r is distributed in the hope that it will be useful, 295s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 295s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 295s > ## GNU General Public License for more details. 295s > ## 295s > ## You should have received a copy of the GNU General Public License along 295s > ## with this program; if not, write to the Free Software Foundation, Inc., 295s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 295s > 295s > library(git2r) 295s > 295s > ## For debugging 295s > sessionInfo() 295s R version 4.4.3 (2025-02-28) 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s Running under: Ubuntu Plucky Puffin (development branch) 295s 295s Matrix products: default 295s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 295s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 295s 295s locale: 295s [1] C 295s 295s time zone: Etc/UTC 295s tzcode source: system (glibc) 295s 295s attached base packages: 295s [1] stats graphics grDevices utils datasets methods base 295s 295s other attached packages: 295s [1] git2r_0.35.0 295s 295s loaded via a namespace (and not attached): 295s [1] compiler_4.4.3 295s > libgit2_version() 295s $major 295s [1] 1 295s 295s $minor 295s [1] 9 295s 295s $rev 295s [1] 0 295s 295s > libgit2_features() 295s $threads 295s [1] TRUE 295s 295s $https 295s [1] TRUE 295s 295s $ssh 295s [1] TRUE 295s 295s > 295s > 295s > ## Test to coerce 295s > git_t <- structure(list(time = 1395567947, offset = 60), 295s + class = "git_time") 295s > stopifnot(identical(as.character(git_t), "2014-03-23 09:45:47 GMT")) 295s > stopifnot(identical(as.character(git_t, usetz = FALSE), "2014-03-23 09:45:47")) 295s > stopifnot(identical(as.POSIXct(git_t), 295s + as.POSIXct(1395567947, tz = "GMT", origin = "1970-01-01"))) 295s > stopifnot(identical(print(git_t), git_t)) 295s 2014-03-23 09:45:47 GMT 295s > 295s > as.POSIXct(1395567947, origin = "1970-01-01", tz = "-03") 295s [1] "2014-03-23 09:45:47" 295s > 295s > ## Test that origin/tz can be passed to as.POSIXct 295s > stopifnot(identical(as.POSIXct(git_t, tz = "Europe/Stockholm", 295s + origin = "1980-02-02"), 295s + as.POSIXct(1395567947, tz = "Europe/Stockholm", 295s + origin = "1980-02-02"))) 295s > 295s > ## Test that origin/tz can be passed to as.character 295s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 295s + origin = "1980-02-02"), 295s + "2024-04-23 11:45:47 CEST")) 295s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 295s + origin = "1980-02-02", usetz = FALSE), 295s + "2024-04-23 11:45:47")) 295s > 295s > ## Test that origin/tz can be passed to print 295s > stopifnot(identical( 295s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 295s + origin = "1980-02-02")), 295s + "2024-04-23 11:45:47 CEST" 295s + )) 295s > stopifnot(identical( 295s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 295s + origin = "1980-02-02", usetz = FALSE)), 295s + "2024-04-23 11:45:47" 295s + )) 295s > 295s BEGIN TEST tree.R 295s 295s R version 4.4.3 (2025-02-28) -- "Trophy Case" 295s Copyright (C) 2025 The R Foundation for Statistical Computing 295s Platform: arm-unknown-linux-gnueabihf (32-bit) 295s 295s R is free software and comes with ABSOLUTELY NO WARRANTY. 295s You are welcome to redistribute it under certain conditions. 295s Type 'license()' or 'licence()' for distribution details. 295s 295s R is a collaborative project with many contributors. 295s Type 'contributors()' for more information and 295s 'citation()' on how to cite R or R packages in publications. 295s 295s Type 'demo()' for some demos, 'help()' for on-line help, or 295s 'help.start()' for an HTML browser interface to help. 295s Type 'q()' to quit R. 295s 296s > ## git2r, R bindings to the libgit2 library. 296s > ## Copyright (C) 2013-2023 The git2r contributors 296s > ## 296s > ## This program is free software; you can redistribute it and/or modify 296s > ## it under the terms of the GNU General Public License, version 2, 296s > ## as published by the Free Software Foundation. 296s > ## 296s > ## git2r is distributed in the hope that it will be useful, 296s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 296s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 296s > ## GNU General Public License for more details. 296s > ## 296s > ## You should have received a copy of the GNU General Public License along 296s > ## with this program; if not, write to the Free Software Foundation, Inc., 296s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 296s > 296s > library("git2r") 296s > 296s > ## For debugging 296s > sessionInfo() 296s R version 4.4.3 (2025-02-28) 296s Platform: arm-unknown-linux-gnueabihf (32-bit) 296s Running under: Ubuntu Plucky Puffin (development branch) 296s 296s Matrix products: default 296s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 296s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 296s 296s locale: 296s [1] C 296s 296s time zone: Etc/UTC 296s tzcode source: system (glibc) 296s 296s attached base packages: 296s [1] stats graphics grDevices utils datasets methods base 296s 296s other attached packages: 296s [1] git2r_0.35.0 296s 296s loaded via a namespace (and not attached): 296s [1] compiler_4.4.3 296s > libgit2_version() 296s $major 296s [1] 1 296s 296s $minor 296s [1] 9 296s 296s $rev 296s [1] 0 296s 296s > libgit2_features() 296s $threads 296s [1] TRUE 296s 296s $https 296s [1] TRUE 296s 296s $ssh 296s [1] TRUE 296s 296s > 296s > 296s > ## Create a directory in tempdir 296s > path <- tempfile(pattern = "git2r-") 296s > dir.create(path) 296s > 296s > ## Initialize a repository 296s > repo <- init(path) 296s > config(repo, user.name = "Alice", user.email = "alice@example.org") 296s > 296s > ## Create a file 296s > f <- file(file.path(path, "test.txt"), "wb") 296s > writeChar("Hello world!\n", f, eos = NULL) 296s > close(f) 296s > 296s > ## add and commit 296s > add(repo, "test.txt") 296s > commit(repo, "Commit message") 296s [68aa0b7] 2025-03-15: Commit message 296s > 296s > ## Check tree 296s > stopifnot(is_tree(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"))) 296s > stopifnot(identical( 296s + sha(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")), 296s + "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")) 296s > stopifnot(is_tree(tree(commits(repo)[[1]]))) 296s > stopifnot(identical(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"), 296s + tree(commits(repo)[[1]]))) 296s > stopifnot(identical(length(tree(commits(repo)[[1]])), 1L)) 296s > 296s > ## Coerce to a data.frame and check column names 296s > stopifnot(identical(names(as.data.frame(tree(commits(repo)[[1]]))), 296s + c("mode", "type", "sha", "name"))) 296s > 296s > ## Coerce to list and check length 296s > stopifnot(identical(length(as.list(tree(last_commit(repo)))), 1L)) 296s > 296s > ## Print and summary 296s > stopifnot(identical(print(tree(last_commit(repo))), tree(last_commit(repo)))) 296s tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 296s 296s mode type sha name 296s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 296s > summary(tree(last_commit(repo))) 296s mode type sha name 296s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 296s > 296s > ## Check indexing 296s > stopifnot(is_blob(tree(last_commit(repo))[TRUE])) 296s > stopifnot(is_blob(tree(last_commit(repo))["test.txt"])) 296s > res <- tools::assertError(tree(last_commit(repo))[data.frame()]) 296s > stopifnot(length(grep("Invalid index", res[[1]]$message)) > 0) 296s > 296s > ## Check ls_tree 296s > stopifnot(identical(ls_tree(repo = repo), ls_tree(repo = path))) 296s > stopifnot(identical(ls_tree(tree = sha(tree(last_commit(repo))), repo = repo), 296s + ls_tree(repo = repo))) 296s > 296s > ## Cleanup 296s > unlink(path, recursive = TRUE) 296s > 296s BEGIN TEST when.R 296s 296s R version 4.4.3 (2025-02-28) -- "Trophy Case" 296s Copyright (C) 2025 The R Foundation for Statistical Computing 296s Platform: arm-unknown-linux-gnueabihf (32-bit) 296s 296s R is free software and comes with ABSOLUTELY NO WARRANTY. 296s You are welcome to redistribute it under certain conditions. 296s Type 'license()' or 'licence()' for distribution details. 296s 296s R is a collaborative project with many contributors. 296s Type 'contributors()' for more information and 296s 'citation()' on how to cite R or R packages in publications. 296s 296s Type 'demo()' for some demos, 'help()' for on-line help, or 296s 'help.start()' for an HTML browser interface to help. 296s Type 'q()' to quit R. 296s 296s > ## git2r, R bindings to the libgit2 library. 296s > ## Copyright (C) 2013-2023 The git2r contributors 296s > ## 296s > ## This program is free software; you can redistribute it and/or modify 296s > ## it under the terms of the GNU General Public License, version 2, 296s > ## as published by the Free Software Foundation. 296s > ## 296s > ## git2r is distributed in the hope that it will be useful, 296s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 296s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 296s > ## GNU General Public License for more details. 296s > ## 296s > ## You should have received a copy of the GNU General Public License along 296s > ## with this program; if not, write to the Free Software Foundation, Inc., 296s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 296s > 296s > library("git2r") 296s > 296s > ## For debugging 296s > sessionInfo() 296s R version 4.4.3 (2025-02-28) 296s Platform: arm-unknown-linux-gnueabihf (32-bit) 296s Running under: Ubuntu Plucky Puffin (development branch) 296s 296s Matrix products: default 296s BLAS: /usr/lib/arm-linux-gnueabihf/blas/libblas.so.3.12.1 296s LAPACK: /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 296s 296s locale: 296s [1] C 296s 296s time zone: Etc/UTC 296s tzcode source: system (glibc) 296s 296s attached base packages: 296s [1] stats graphics grDevices utils datasets methods base 296s 296s other attached packages: 296s [1] git2r_0.35.0 296s 296s loaded via a namespace (and not attached): 296s [1] compiler_4.4.3 296s > libgit2_version() 296s $major 296s [1] 1 296s 296s $minor 296s [1] 9 296s 296s $rev 296s [1] 0 296s 296s > libgit2_features() 296s $threads 296s [1] TRUE 296s 296s $https 296s [1] TRUE 296s 296s $ssh 296s [1] TRUE 296s 296s > 296s > 296s > ## Check when method 296s > w1 <- structure(list(time = 1395567947, offset = 60), 296s + class = "git_time") 296s > stopifnot(identical(when(w1), "2014-03-23 09:45:47 GMT")) 296s > stopifnot(identical(when(w1, usetz = FALSE), "2014-03-23 09:45:47")) 296s > stopifnot(identical(when(w1, tz = "Europe/Stockholm", origin = "1980-02-02"), 296s + "2024-04-23 11:45:47 CEST")) 296s > 296s > s1 <- structure(list(name = "Alice", email = "alice@example.org", when = w1), 296s + class = "git_signature") 296s > stopifnot(identical(when(s1), "2014-03-23 09:45:47 GMT")) 296s > stopifnot(identical(when(s1, usetz = FALSE), "2014-03-23 09:45:47")) 296s > stopifnot(identical(when(s1, tz = "Europe/Stockholm", origin = "1980-02-02"), 296s + "2024-04-23 11:45:47 CEST")) 296s > 296s > w2 <- structure(list(time = 1395567950, offset = 60), 296s + class = "git_time") 296s > s2 <- structure(list(name = "Alice", email = "alice@example.org", when = w2), 296s + class = "git_signature") 296s > c1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 296s + author = s1, 296s + committer = s2, 296s + summary = "A commit summary", 296s + message = "A commit message"), 296s + class = "git_commit") 296s > stopifnot(identical(when(c1), "2014-03-23 09:45:47 GMT")) 296s > stopifnot(identical(when(c1, usetz = FALSE), "2014-03-23 09:45:47")) 296s > stopifnot(identical(when(c1, tz = "Europe/Stockholm", origin = "1980-02-02"), 296s + "2024-04-23 11:45:47 CEST")) 296s > 296s > t1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 296s + message = "A tag message", 296s + name = "A tage name", 296s + tagger = s1, 296s + target = "166f3f779fd7e4165aaa43f2828050ce040052b0"), 296s + class = "git_tag") 296s > stopifnot(identical(when(t1), "2014-03-23 09:45:47 GMT")) 296s > stopifnot(identical(when(t1, usetz = FALSE), "2014-03-23 09:45:47")) 296s > stopifnot(identical(when(t1, tz = "Europe/Stockholm", origin = "1980-02-02"), 296s + "2024-04-23 11:45:47 CEST")) 296s > 296s autopkgtest [16:15:25]: test run-unit-test: -----------------------] 300s run-unit-test PASS 300s autopkgtest [16:15:29]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 304s autopkgtest [16:15:33]: test pkg-r-autopkgtest: preparing testbed 306s Reading package lists... 306s Building dependency tree... 306s Reading state information... 306s Starting pkgProblemResolver with broken count: 0 307s Starting 2 pkgProblemResolver with broken count: 0 307s Done 308s The following NEW packages will be installed: 308s build-essential cpp cpp-14 cpp-14-arm-linux-gnueabihf 308s cpp-arm-linux-gnueabihf dctrl-tools g++ g++-14 g++-14-arm-linux-gnueabihf 308s g++-arm-linux-gnueabihf gcc gcc-14 gcc-14-arm-linux-gnueabihf 308s gcc-arm-linux-gnueabihf gfortran gfortran-14 gfortran-14-arm-linux-gnueabihf 308s gfortran-arm-linux-gnueabihf icu-devtools libasan8 libblas-dev libbz2-dev 308s libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libdeflate-dev libgcc-14-dev 308s libgfortran-14-dev libicu-dev libisl23 libjpeg-dev libjpeg-turbo8-dev 308s libjpeg8-dev liblapack-dev liblzma-dev libmpc3 libncurses-dev libpcre2-16-0 308s libpcre2-32-0 libpcre2-dev libpcre2-posix3 libpkgconf3 libpng-dev 308s libreadline-dev libstdc++-14-dev libtirpc-dev libubsan1 linux-libc-dev 308s pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev rpcsvc-proto zlib1g-dev 308s 0 upgraded, 55 newly installed, 0 to remove and 0 not upgraded. 308s Need to get 78.1 MB of archives. 308s After this operation, 243 MB of additional disk space will be used. 308s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf libc-dev-bin armhf 2.41-1ubuntu2 [23.0 kB] 308s Get:2 http://ftpmaster.internal/ubuntu plucky/main armhf linux-libc-dev armhf 6.14.0-10.10 [1683 kB] 310s Get:3 http://ftpmaster.internal/ubuntu plucky/main armhf libcrypt-dev armhf 1:4.4.38-1 [120 kB] 310s Get:4 http://ftpmaster.internal/ubuntu plucky/main armhf rpcsvc-proto armhf 1.4.2-0ubuntu7 [62.2 kB] 310s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main armhf libc6-dev armhf 2.41-1ubuntu2 [1396 kB] 312s Get:6 http://ftpmaster.internal/ubuntu plucky/main armhf libisl23 armhf 0.27-1 [546 kB] 312s Get:7 http://ftpmaster.internal/ubuntu plucky/main armhf libmpc3 armhf 1.3.1-1build2 [47.1 kB] 312s Get:8 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-14-arm-linux-gnueabihf armhf 14.2.0-17ubuntu3 [9220 kB] 323s Get:9 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-14 armhf 14.2.0-17ubuntu3 [1030 B] 323s Get:10 http://ftpmaster.internal/ubuntu plucky/main armhf cpp-arm-linux-gnueabihf armhf 4:14.2.0-1ubuntu1 [5578 B] 323s Get:11 http://ftpmaster.internal/ubuntu plucky/main armhf cpp armhf 4:14.2.0-1ubuntu1 [22.4 kB] 323s Get:12 http://ftpmaster.internal/ubuntu plucky/main armhf libcc1-0 armhf 15-20250222-0ubuntu1 [38.9 kB] 323s Get:13 http://ftpmaster.internal/ubuntu plucky/main armhf libasan8 armhf 15-20250222-0ubuntu1 [2955 kB] 327s Get:14 http://ftpmaster.internal/ubuntu plucky/main armhf libubsan1 armhf 15-20250222-0ubuntu1 [1191 kB] 328s Get:15 http://ftpmaster.internal/ubuntu plucky/main armhf libgcc-14-dev armhf 14.2.0-17ubuntu3 [897 kB] 329s Get:16 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14-arm-linux-gnueabihf armhf 14.2.0-17ubuntu3 [18.0 MB] 348s Get:17 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-14 armhf 14.2.0-17ubuntu3 [506 kB] 348s Get:18 http://ftpmaster.internal/ubuntu plucky/main armhf gcc-arm-linux-gnueabihf armhf 4:14.2.0-1ubuntu1 [1218 B] 348s Get:19 http://ftpmaster.internal/ubuntu plucky/main armhf gcc armhf 4:14.2.0-1ubuntu1 [5004 B] 348s Get:20 http://ftpmaster.internal/ubuntu plucky/main armhf libstdc++-14-dev armhf 14.2.0-17ubuntu3 [2573 kB] 351s Get:21 http://ftpmaster.internal/ubuntu plucky/main armhf g++-14-arm-linux-gnueabihf armhf 14.2.0-17ubuntu3 [10.5 MB] 361s Get:22 http://ftpmaster.internal/ubuntu plucky/main armhf g++-14 armhf 14.2.0-17ubuntu3 [21.8 kB] 361s Get:23 http://ftpmaster.internal/ubuntu plucky/main armhf g++-arm-linux-gnueabihf armhf 4:14.2.0-1ubuntu1 [966 B] 361s Get:24 http://ftpmaster.internal/ubuntu plucky/main armhf g++ armhf 4:14.2.0-1ubuntu1 [1084 B] 361s Get:25 http://ftpmaster.internal/ubuntu plucky/main armhf build-essential armhf 12.10ubuntu1 [4928 B] 361s Get:26 http://ftpmaster.internal/ubuntu plucky/main armhf dctrl-tools armhf 2.24-3build3 [94.7 kB] 361s Get:27 http://ftpmaster.internal/ubuntu plucky/main armhf libgfortran-14-dev armhf 14.2.0-17ubuntu3 [370 kB] 362s Get:28 http://ftpmaster.internal/ubuntu plucky/main armhf gfortran-14-arm-linux-gnueabihf armhf 14.2.0-17ubuntu3 [9763 kB] 372s Get:29 http://ftpmaster.internal/ubuntu plucky/main armhf gfortran-14 armhf 14.2.0-17ubuntu3 [13.6 kB] 372s Get:30 http://ftpmaster.internal/ubuntu plucky/main armhf gfortran-arm-linux-gnueabihf armhf 4:14.2.0-1ubuntu1 [1026 B] 372s Get:31 http://ftpmaster.internal/ubuntu plucky/main armhf gfortran armhf 4:14.2.0-1ubuntu1 [1166 B] 372s Get:32 http://ftpmaster.internal/ubuntu plucky/main armhf icu-devtools armhf 76.1-1ubuntu2 [206 kB] 372s Get:33 http://ftpmaster.internal/ubuntu plucky/main armhf libblas-dev armhf 3.12.1-2 [141 kB] 372s Get:34 http://ftpmaster.internal/ubuntu plucky/main armhf libbz2-dev armhf 1.0.8-6 [30.9 kB] 372s Get:35 http://ftpmaster.internal/ubuntu plucky/main armhf libdeflate-dev armhf 1.23-1 [45.0 kB] 372s Get:36 http://ftpmaster.internal/ubuntu plucky/main armhf libicu-dev armhf 76.1-1ubuntu2 [12.0 MB] 384s Get:37 http://ftpmaster.internal/ubuntu plucky/main armhf libjpeg-turbo8-dev armhf 2.1.5-3ubuntu2 [265 kB] 385s Get:38 http://ftpmaster.internal/ubuntu plucky/main armhf libjpeg8-dev armhf 8c-2ubuntu11 [1484 B] 385s Get:39 http://ftpmaster.internal/ubuntu plucky/main armhf libjpeg-dev armhf 8c-2ubuntu11 [1482 B] 385s Get:40 http://ftpmaster.internal/ubuntu plucky/main armhf liblapack-dev armhf 3.12.1-2 [2207 kB] 387s Get:41 http://ftpmaster.internal/ubuntu plucky/main armhf libncurses-dev armhf 6.5+20250216-2 [345 kB] 387s Get:42 http://ftpmaster.internal/ubuntu plucky/main armhf libpcre2-16-0 armhf 10.45-1 [207 kB] 387s Get:43 http://ftpmaster.internal/ubuntu plucky/main armhf libpcre2-32-0 armhf 10.45-1 [197 kB] 387s Get:44 http://ftpmaster.internal/ubuntu plucky/main armhf libpcre2-posix3 armhf 10.45-1 [6300 B] 387s Get:45 http://ftpmaster.internal/ubuntu plucky/main armhf libpcre2-dev armhf 10.45-1 [752 kB] 388s Get:46 http://ftpmaster.internal/ubuntu plucky/main armhf libpkgconf3 armhf 1.8.1-4 [26.6 kB] 388s Get:47 http://ftpmaster.internal/ubuntu plucky/main armhf zlib1g-dev armhf 1:1.3.dfsg+really1.3.1-1ubuntu1 [880 kB] 389s Get:48 http://ftpmaster.internal/ubuntu plucky/main armhf libpng-dev armhf 1.6.47-1 [251 kB] 389s Get:49 http://ftpmaster.internal/ubuntu plucky/main armhf libreadline-dev armhf 8.2-6 [153 kB] 389s Get:50 http://ftpmaster.internal/ubuntu plucky/main armhf liblzma-dev armhf 5.6.4-1 [166 kB] 390s Get:51 http://ftpmaster.internal/ubuntu plucky/main armhf pkgconf-bin armhf 1.8.1-4 [21.2 kB] 390s Get:52 http://ftpmaster.internal/ubuntu plucky/main armhf pkgconf armhf 1.8.1-4 [16.8 kB] 390s Get:53 http://ftpmaster.internal/ubuntu plucky/main armhf libtirpc-dev armhf 1.3.4+ds-1.3 [184 kB] 390s Get:54 http://ftpmaster.internal/ubuntu plucky/universe armhf r-base-dev all 4.4.3-1 [4176 B] 390s Get:55 http://ftpmaster.internal/ubuntu plucky/universe armhf pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 390s Fetched 78.1 MB in 1min 22s (950 kB/s) 390s Selecting previously unselected package libc-dev-bin. 390s (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 ... 66914 files and directories currently installed.) 390s Preparing to unpack .../00-libc-dev-bin_2.41-1ubuntu2_armhf.deb ... 390s Unpacking libc-dev-bin (2.41-1ubuntu2) ... 390s Selecting previously unselected package linux-libc-dev:armhf. 390s Preparing to unpack .../01-linux-libc-dev_6.14.0-10.10_armhf.deb ... 390s Unpacking linux-libc-dev:armhf (6.14.0-10.10) ... 391s Selecting previously unselected package libcrypt-dev:armhf. 391s Preparing to unpack .../02-libcrypt-dev_1%3a4.4.38-1_armhf.deb ... 391s Unpacking libcrypt-dev:armhf (1:4.4.38-1) ... 391s Selecting previously unselected package rpcsvc-proto. 391s Preparing to unpack .../03-rpcsvc-proto_1.4.2-0ubuntu7_armhf.deb ... 391s Unpacking rpcsvc-proto (1.4.2-0ubuntu7) ... 391s Selecting previously unselected package libc6-dev:armhf. 391s Preparing to unpack .../04-libc6-dev_2.41-1ubuntu2_armhf.deb ... 391s Unpacking libc6-dev:armhf (2.41-1ubuntu2) ... 391s Selecting previously unselected package libisl23:armhf. 391s Preparing to unpack .../05-libisl23_0.27-1_armhf.deb ... 391s Unpacking libisl23:armhf (0.27-1) ... 391s Selecting previously unselected package libmpc3:armhf. 391s Preparing to unpack .../06-libmpc3_1.3.1-1build2_armhf.deb ... 391s Unpacking libmpc3:armhf (1.3.1-1build2) ... 391s Selecting previously unselected package cpp-14-arm-linux-gnueabihf. 391s Preparing to unpack .../07-cpp-14-arm-linux-gnueabihf_14.2.0-17ubuntu3_armhf.deb ... 391s Unpacking cpp-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 391s Selecting previously unselected package cpp-14. 391s Preparing to unpack .../08-cpp-14_14.2.0-17ubuntu3_armhf.deb ... 391s Unpacking cpp-14 (14.2.0-17ubuntu3) ... 391s Selecting previously unselected package cpp-arm-linux-gnueabihf. 391s Preparing to unpack .../09-cpp-arm-linux-gnueabihf_4%3a14.2.0-1ubuntu1_armhf.deb ... 391s Unpacking cpp-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 391s Selecting previously unselected package cpp. 391s Preparing to unpack .../10-cpp_4%3a14.2.0-1ubuntu1_armhf.deb ... 391s Unpacking cpp (4:14.2.0-1ubuntu1) ... 391s Selecting previously unselected package libcc1-0:armhf. 391s Preparing to unpack .../11-libcc1-0_15-20250222-0ubuntu1_armhf.deb ... 391s Unpacking libcc1-0:armhf (15-20250222-0ubuntu1) ... 391s Selecting previously unselected package libasan8:armhf. 391s Preparing to unpack .../12-libasan8_15-20250222-0ubuntu1_armhf.deb ... 391s Unpacking libasan8:armhf (15-20250222-0ubuntu1) ... 391s Selecting previously unselected package libubsan1:armhf. 391s Preparing to unpack .../13-libubsan1_15-20250222-0ubuntu1_armhf.deb ... 391s Unpacking libubsan1:armhf (15-20250222-0ubuntu1) ... 391s Selecting previously unselected package libgcc-14-dev:armhf. 391s Preparing to unpack .../14-libgcc-14-dev_14.2.0-17ubuntu3_armhf.deb ... 391s Unpacking libgcc-14-dev:armhf (14.2.0-17ubuntu3) ... 392s Selecting previously unselected package gcc-14-arm-linux-gnueabihf. 392s Preparing to unpack .../15-gcc-14-arm-linux-gnueabihf_14.2.0-17ubuntu3_armhf.deb ... 392s Unpacking gcc-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 392s Selecting previously unselected package gcc-14. 392s Preparing to unpack .../16-gcc-14_14.2.0-17ubuntu3_armhf.deb ... 392s Unpacking gcc-14 (14.2.0-17ubuntu3) ... 392s Selecting previously unselected package gcc-arm-linux-gnueabihf. 392s Preparing to unpack .../17-gcc-arm-linux-gnueabihf_4%3a14.2.0-1ubuntu1_armhf.deb ... 392s Unpacking gcc-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 392s Selecting previously unselected package gcc. 392s Preparing to unpack .../18-gcc_4%3a14.2.0-1ubuntu1_armhf.deb ... 392s Unpacking gcc (4:14.2.0-1ubuntu1) ... 392s Selecting previously unselected package libstdc++-14-dev:armhf. 392s Preparing to unpack .../19-libstdc++-14-dev_14.2.0-17ubuntu3_armhf.deb ... 392s Unpacking libstdc++-14-dev:armhf (14.2.0-17ubuntu3) ... 392s Selecting previously unselected package g++-14-arm-linux-gnueabihf. 392s Preparing to unpack .../20-g++-14-arm-linux-gnueabihf_14.2.0-17ubuntu3_armhf.deb ... 392s Unpacking g++-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 393s Selecting previously unselected package g++-14. 393s Preparing to unpack .../21-g++-14_14.2.0-17ubuntu3_armhf.deb ... 393s Unpacking g++-14 (14.2.0-17ubuntu3) ... 393s Selecting previously unselected package g++-arm-linux-gnueabihf. 393s Preparing to unpack .../22-g++-arm-linux-gnueabihf_4%3a14.2.0-1ubuntu1_armhf.deb ... 393s Unpacking g++-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 393s Selecting previously unselected package g++. 393s Preparing to unpack .../23-g++_4%3a14.2.0-1ubuntu1_armhf.deb ... 393s Unpacking g++ (4:14.2.0-1ubuntu1) ... 393s Selecting previously unselected package build-essential. 393s Preparing to unpack .../24-build-essential_12.10ubuntu1_armhf.deb ... 393s Unpacking build-essential (12.10ubuntu1) ... 393s Selecting previously unselected package dctrl-tools. 393s Preparing to unpack .../25-dctrl-tools_2.24-3build3_armhf.deb ... 393s Unpacking dctrl-tools (2.24-3build3) ... 393s Selecting previously unselected package libgfortran-14-dev:armhf. 393s Preparing to unpack .../26-libgfortran-14-dev_14.2.0-17ubuntu3_armhf.deb ... 393s Unpacking libgfortran-14-dev:armhf (14.2.0-17ubuntu3) ... 393s Selecting previously unselected package gfortran-14-arm-linux-gnueabihf. 393s Preparing to unpack .../27-gfortran-14-arm-linux-gnueabihf_14.2.0-17ubuntu3_armhf.deb ... 393s Unpacking gfortran-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 393s Selecting previously unselected package gfortran-14. 393s Preparing to unpack .../28-gfortran-14_14.2.0-17ubuntu3_armhf.deb ... 393s Unpacking gfortran-14 (14.2.0-17ubuntu3) ... 393s Selecting previously unselected package gfortran-arm-linux-gnueabihf. 393s Preparing to unpack .../29-gfortran-arm-linux-gnueabihf_4%3a14.2.0-1ubuntu1_armhf.deb ... 393s Unpacking gfortran-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 393s Selecting previously unselected package gfortran. 393s Preparing to unpack .../30-gfortran_4%3a14.2.0-1ubuntu1_armhf.deb ... 393s Unpacking gfortran (4:14.2.0-1ubuntu1) ... 393s Selecting previously unselected package icu-devtools. 393s Preparing to unpack .../31-icu-devtools_76.1-1ubuntu2_armhf.deb ... 393s Unpacking icu-devtools (76.1-1ubuntu2) ... 393s Selecting previously unselected package libblas-dev:armhf. 393s Preparing to unpack .../32-libblas-dev_3.12.1-2_armhf.deb ... 393s Unpacking libblas-dev:armhf (3.12.1-2) ... 393s Selecting previously unselected package libbz2-dev:armhf. 393s Preparing to unpack .../33-libbz2-dev_1.0.8-6_armhf.deb ... 393s Unpacking libbz2-dev:armhf (1.0.8-6) ... 393s Selecting previously unselected package libdeflate-dev:armhf. 393s Preparing to unpack .../34-libdeflate-dev_1.23-1_armhf.deb ... 393s Unpacking libdeflate-dev:armhf (1.23-1) ... 393s Selecting previously unselected package libicu-dev:armhf. 393s Preparing to unpack .../35-libicu-dev_76.1-1ubuntu2_armhf.deb ... 393s Unpacking libicu-dev:armhf (76.1-1ubuntu2) ... 394s Selecting previously unselected package libjpeg-turbo8-dev:armhf. 394s Preparing to unpack .../36-libjpeg-turbo8-dev_2.1.5-3ubuntu2_armhf.deb ... 394s Unpacking libjpeg-turbo8-dev:armhf (2.1.5-3ubuntu2) ... 394s Selecting previously unselected package libjpeg8-dev:armhf. 394s Preparing to unpack .../37-libjpeg8-dev_8c-2ubuntu11_armhf.deb ... 394s Unpacking libjpeg8-dev:armhf (8c-2ubuntu11) ... 394s Selecting previously unselected package libjpeg-dev:armhf. 394s Preparing to unpack .../38-libjpeg-dev_8c-2ubuntu11_armhf.deb ... 394s Unpacking libjpeg-dev:armhf (8c-2ubuntu11) ... 394s Selecting previously unselected package liblapack-dev:armhf. 394s Preparing to unpack .../39-liblapack-dev_3.12.1-2_armhf.deb ... 394s Unpacking liblapack-dev:armhf (3.12.1-2) ... 394s Selecting previously unselected package libncurses-dev:armhf. 394s Preparing to unpack .../40-libncurses-dev_6.5+20250216-2_armhf.deb ... 394s Unpacking libncurses-dev:armhf (6.5+20250216-2) ... 394s Selecting previously unselected package libpcre2-16-0:armhf. 394s Preparing to unpack .../41-libpcre2-16-0_10.45-1_armhf.deb ... 394s Unpacking libpcre2-16-0:armhf (10.45-1) ... 394s Selecting previously unselected package libpcre2-32-0:armhf. 394s Preparing to unpack .../42-libpcre2-32-0_10.45-1_armhf.deb ... 394s Unpacking libpcre2-32-0:armhf (10.45-1) ... 394s Selecting previously unselected package libpcre2-posix3:armhf. 394s Preparing to unpack .../43-libpcre2-posix3_10.45-1_armhf.deb ... 394s Unpacking libpcre2-posix3:armhf (10.45-1) ... 394s Selecting previously unselected package libpcre2-dev:armhf. 394s Preparing to unpack .../44-libpcre2-dev_10.45-1_armhf.deb ... 394s Unpacking libpcre2-dev:armhf (10.45-1) ... 394s Selecting previously unselected package libpkgconf3:armhf. 394s Preparing to unpack .../45-libpkgconf3_1.8.1-4_armhf.deb ... 394s Unpacking libpkgconf3:armhf (1.8.1-4) ... 394s Selecting previously unselected package zlib1g-dev:armhf. 394s Preparing to unpack .../46-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_armhf.deb ... 394s Unpacking zlib1g-dev:armhf (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 394s Selecting previously unselected package libpng-dev:armhf. 394s Preparing to unpack .../47-libpng-dev_1.6.47-1_armhf.deb ... 394s Unpacking libpng-dev:armhf (1.6.47-1) ... 394s Selecting previously unselected package libreadline-dev:armhf. 394s Preparing to unpack .../48-libreadline-dev_8.2-6_armhf.deb ... 394s Unpacking libreadline-dev:armhf (8.2-6) ... 394s Selecting previously unselected package liblzma-dev:armhf. 394s Preparing to unpack .../49-liblzma-dev_5.6.4-1_armhf.deb ... 394s Unpacking liblzma-dev:armhf (5.6.4-1) ... 394s Selecting previously unselected package pkgconf-bin. 394s Preparing to unpack .../50-pkgconf-bin_1.8.1-4_armhf.deb ... 394s Unpacking pkgconf-bin (1.8.1-4) ... 394s Selecting previously unselected package pkgconf:armhf. 394s Preparing to unpack .../51-pkgconf_1.8.1-4_armhf.deb ... 394s Unpacking pkgconf:armhf (1.8.1-4) ... 394s Selecting previously unselected package libtirpc-dev:armhf. 394s Preparing to unpack .../52-libtirpc-dev_1.3.4+ds-1.3_armhf.deb ... 394s Unpacking libtirpc-dev:armhf (1.3.4+ds-1.3) ... 395s Selecting previously unselected package r-base-dev. 395s Preparing to unpack .../53-r-base-dev_4.4.3-1_all.deb ... 395s Unpacking r-base-dev (4.4.3-1) ... 395s Selecting previously unselected package pkg-r-autopkgtest. 395s Preparing to unpack .../54-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 395s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 395s Setting up linux-libc-dev:armhf (6.14.0-10.10) ... 395s Setting up libpcre2-16-0:armhf (10.45-1) ... 395s Setting up libpcre2-32-0:armhf (10.45-1) ... 395s Setting up libtirpc-dev:armhf (1.3.4+ds-1.3) ... 395s Setting up libpkgconf3:armhf (1.8.1-4) ... 395s Setting up rpcsvc-proto (1.4.2-0ubuntu7) ... 395s Setting up libmpc3:armhf (1.3.1-1build2) ... 395s Setting up icu-devtools (76.1-1ubuntu2) ... 395s Setting up pkgconf-bin (1.8.1-4) ... 395s Setting up liblzma-dev:armhf (5.6.4-1) ... 395s Setting up libubsan1:armhf (15-20250222-0ubuntu1) ... 395s Setting up libpcre2-posix3:armhf (10.45-1) ... 395s Setting up libcrypt-dev:armhf (1:4.4.38-1) ... 395s Setting up libasan8:armhf (15-20250222-0ubuntu1) ... 395s Setting up libgcc-14-dev:armhf (14.2.0-17ubuntu3) ... 395s Setting up libisl23:armhf (0.27-1) ... 395s Setting up libc-dev-bin (2.41-1ubuntu2) ... 395s Setting up libdeflate-dev:armhf (1.23-1) ... 395s Setting up libcc1-0:armhf (15-20250222-0ubuntu1) ... 395s Setting up libblas-dev:armhf (3.12.1-2) ... 395s update-alternatives: using /usr/lib/arm-linux-gnueabihf/blas/libblas.so to provide /usr/lib/arm-linux-gnueabihf/libblas.so (libblas.so-arm-linux-gnueabihf) in auto mode 395s Setting up dctrl-tools (2.24-3build3) ... 395s Setting up cpp-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 395s Setting up libgfortran-14-dev:armhf (14.2.0-17ubuntu3) ... 395s Setting up gcc-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 395s Setting up pkgconf:armhf (1.8.1-4) ... 395s Setting up liblapack-dev:armhf (3.12.1-2) ... 395s update-alternatives: using /usr/lib/arm-linux-gnueabihf/lapack/liblapack.so to provide /usr/lib/arm-linux-gnueabihf/liblapack.so (liblapack.so-arm-linux-gnueabihf) in auto mode 395s Setting up cpp-14 (14.2.0-17ubuntu3) ... 395s Setting up libc6-dev:armhf (2.41-1ubuntu2) ... 395s Setting up libstdc++-14-dev:armhf (14.2.0-17ubuntu3) ... 395s Setting up libicu-dev:armhf (76.1-1ubuntu2) ... 395s Setting up cpp-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 395s Setting up gfortran-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 395s Setting up libbz2-dev:armhf (1.0.8-6) ... 395s Setting up gcc-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 395s Setting up g++-14-arm-linux-gnueabihf (14.2.0-17ubuntu3) ... 395s Setting up libjpeg-turbo8-dev:armhf (2.1.5-3ubuntu2) ... 395s Setting up libncurses-dev:armhf (6.5+20250216-2) ... 395s Setting up libpcre2-dev:armhf (10.45-1) ... 395s Setting up libreadline-dev:armhf (8.2-6) ... 395s Setting up gcc-14 (14.2.0-17ubuntu3) ... 395s Setting up gfortran-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 395s Setting up zlib1g-dev:armhf (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 395s Setting up cpp (4:14.2.0-1ubuntu1) ... 395s Setting up g++-14 (14.2.0-17ubuntu3) ... 395s Setting up libjpeg8-dev:armhf (8c-2ubuntu11) ... 395s Setting up gfortran-14 (14.2.0-17ubuntu3) ... 395s Setting up g++-arm-linux-gnueabihf (4:14.2.0-1ubuntu1) ... 395s Setting up libpng-dev:armhf (1.6.47-1) ... 395s Setting up libjpeg-dev:armhf (8c-2ubuntu11) ... 395s Setting up gcc (4:14.2.0-1ubuntu1) ... 395s Setting up g++ (4:14.2.0-1ubuntu1) ... 395s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 395s Setting up build-essential (12.10ubuntu1) ... 395s Setting up gfortran (4:14.2.0-1ubuntu1) ... 395s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 395s 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 395s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 395s 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 395s Setting up r-base-dev (4.4.3-1) ... 395s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 395s Processing triggers for libc-bin (2.41-1ubuntu2) ... 395s Processing triggers for man-db (2.13.0-1) ... 396s Processing triggers for install-info (7.1.1-1) ... 404s autopkgtest [16:17:13]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 404s autopkgtest [16:17:13]: test pkg-r-autopkgtest: [----------------------- 405s Test: Try to load the R library git2r 406s 406s R version 4.4.3 (2025-02-28) -- "Trophy Case" 406s Copyright (C) 2025 The R Foundation for Statistical Computing 406s Platform: arm-unknown-linux-gnueabihf (32-bit) 406s 406s R is free software and comes with ABSOLUTELY NO WARRANTY. 406s You are welcome to redistribute it under certain conditions. 406s Type 'license()' or 'licence()' for distribution details. 406s 406s R is a collaborative project with many contributors. 406s Type 'contributors()' for more information and 406s 'citation()' on how to cite R or R packages in publications. 406s 406s Type 'demo()' for some demos, 'help()' for on-line help, or 406s 'help.start()' for an HTML browser interface to help. 406s Type 'q()' to quit R. 406s 406s > library('git2r') 406s > 406s > 406s Other tests are currently unsupported! 406s They will be progressively added. 406s autopkgtest [16:17:15]: test pkg-r-autopkgtest: -----------------------] 410s autopkgtest [16:17:19]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 410s pkg-r-autopkgtest PASS 414s autopkgtest [16:17:23]: @@@@@@@@@@@@@@@@@@@@ summary 414s run-unit-test PASS 414s pkg-r-autopkgtest PASS