0s autopkgtest [18:03:47]: starting date and time: 2025-03-15 18:03:47+0000 0s autopkgtest [18:03:47]: git checkout: 325255d2 Merge branch 'pin-any-arch' into 'ubuntu/production' 0s autopkgtest [18:03:47]: host juju-7f2275-prod-proposed-migration-environment-20; command line: /home/ubuntu/autopkgtest/runner/autopkgtest --output-dir /tmp/autopkgtest-work.z5pxtay2/out --timeout-copy=6000 --setup-commands /home/ubuntu/autopkgtest-cloud/worker-config-production/setup-canonical.sh --apt-pocket=proposed=src:glibc --apt-upgrade r-cran-git2r --timeout-short=300 --timeout-copy=20000 --timeout-build=20000 --env=ADT_TEST_TRIGGERS=glibc/2.41-1ubuntu2 -- ssh -s /home/ubuntu/autopkgtest/ssh-setup/nova -- --flavor autopkgtest-s390x --security-groups autopkgtest-juju-7f2275-prod-proposed-migration-environment-20@bos03-s390x-7.secgroup --name adt-plucky-s390x-r-cran-git2r-20250315-180347-juju-7f2275-prod-proposed-migration-environment-20-43ed09cc-9af8-42f9-99e5-2daa77a578a3 --image adt/ubuntu-plucky-s390x-server --keyname testbed-juju-7f2275-prod-proposed-migration-environment-20 --net-id=net_prod-proposed-migration-s390x -e TERM=linux -e ''"'"'http_proxy=http://squid.internal:3128'"'"'' -e ''"'"'https_proxy=http://squid.internal:3128'"'"'' -e ''"'"'no_proxy=127.0.0.1,127.0.1.1,login.ubuntu.com,localhost,localdomain,novalocal,internal,archive.ubuntu.com,ports.ubuntu.com,security.ubuntu.com,ddebs.ubuntu.com,changelogs.ubuntu.com,keyserver.ubuntu.com,launchpadlibrarian.net,launchpadcontent.net,launchpad.net,10.24.0.0/24,keystone.ps5.canonical.com,objectstorage.prodstack5.canonical.com,radosgw.ps5.canonical.com'"'"'' --mirror=http://ftpmaster.internal/ubuntu/ 139s autopkgtest [18:06:06]: testbed dpkg architecture: s390x 139s autopkgtest [18:06:06]: testbed apt version: 2.9.33 139s autopkgtest [18:06:06]: @@@@@@@@@@@@@@@@@@@@ test bed setup 139s autopkgtest [18:06:06]: testbed release detected to be: None 140s autopkgtest [18:06:07]: updating testbed package index (apt update) 140s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed InRelease [126 kB] 141s Hit:2 http://ftpmaster.internal/ubuntu plucky InRelease 141s Hit:3 http://ftpmaster.internal/ubuntu plucky-updates InRelease 141s Hit:4 http://ftpmaster.internal/ubuntu plucky-security InRelease 141s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse Sources [15.8 kB] 141s Get:6 http://ftpmaster.internal/ubuntu plucky-proposed/universe Sources [379 kB] 141s Get:7 http://ftpmaster.internal/ubuntu plucky-proposed/main Sources [99.7 kB] 141s Get:8 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x Packages [113 kB] 141s Get:9 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x c-n-f Metadata [1824 B] 141s Get:10 http://ftpmaster.internal/ubuntu plucky-proposed/restricted s390x c-n-f Metadata [116 B] 141s Get:11 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x Packages [320 kB] 142s Get:12 http://ftpmaster.internal/ubuntu plucky-proposed/universe s390x c-n-f Metadata [13.4 kB] 142s Get:13 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x Packages [3776 B] 142s Get:14 http://ftpmaster.internal/ubuntu plucky-proposed/multiverse s390x c-n-f Metadata [240 B] 142s Fetched 1073 kB in 2s (708 kB/s) 142s Reading package lists... 143s Reading package lists... 143s Building dependency tree... 143s Reading state information... 143s Calculating upgrade... 143s Calculating upgrade... 143s The following packages were automatically installed and are no longer required: 143s libnsl2 libpython3.12-minimal libpython3.12-stdlib libpython3.12t64 143s linux-headers-6.11.0-8 linux-headers-6.11.0-8-generic 143s linux-modules-6.11.0-8-generic linux-tools-6.11.0-8 143s linux-tools-6.11.0-8-generic 143s Use 'sudo apt autoremove' to remove them. 143s The following packages will be upgraded: 143s pinentry-curses python3-jinja2 strace 144s 3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 144s Need to get 652 kB of archives. 144s After this operation, 27.6 kB of additional disk space will be used. 144s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x strace s390x 6.13+ds-1ubuntu1 [500 kB] 144s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x pinentry-curses s390x 1.3.1-2ubuntu3 [42.9 kB] 144s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x python3-jinja2 all 3.1.5-2ubuntu1 [109 kB] 145s Fetched 652 kB in 1s (721 kB/s) 145s (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 ... 81428 files and directories currently installed.) 145s Preparing to unpack .../strace_6.13+ds-1ubuntu1_s390x.deb ... 145s Unpacking strace (6.13+ds-1ubuntu1) over (6.11-0ubuntu1) ... 145s Preparing to unpack .../pinentry-curses_1.3.1-2ubuntu3_s390x.deb ... 145s Unpacking pinentry-curses (1.3.1-2ubuntu3) over (1.3.1-2ubuntu2) ... 145s Preparing to unpack .../python3-jinja2_3.1.5-2ubuntu1_all.deb ... 145s Unpacking python3-jinja2 (3.1.5-2ubuntu1) over (3.1.5-2) ... 145s Setting up pinentry-curses (1.3.1-2ubuntu3) ... 145s Setting up python3-jinja2 (3.1.5-2ubuntu1) ... 145s Setting up strace (6.13+ds-1ubuntu1) ... 145s Processing triggers for man-db (2.13.0-1) ... 146s Reading package lists... 146s Building dependency tree... 146s Reading state information... 146s Solving dependencies... 146s The following packages will be REMOVED: 146s libnsl2* libpython3.12-minimal* libpython3.12-stdlib* libpython3.12t64* 146s linux-headers-6.11.0-8* linux-headers-6.11.0-8-generic* 146s linux-modules-6.11.0-8-generic* linux-tools-6.11.0-8* 146s linux-tools-6.11.0-8-generic* 146s 0 upgraded, 0 newly installed, 9 to remove and 5 not upgraded. 146s After this operation, 167 MB disk space will be freed. 146s (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 ... 81428 files and directories currently installed.) 146s Removing linux-tools-6.11.0-8-generic (6.11.0-8.8) ... 146s Removing linux-tools-6.11.0-8 (6.11.0-8.8) ... 146s Removing libpython3.12t64:s390x (3.12.9-1) ... 146s Removing libpython3.12-stdlib:s390x (3.12.9-1) ... 146s Removing libnsl2:s390x (1.3.0-3build3) ... 146s Removing libpython3.12-minimal:s390x (3.12.9-1) ... 146s Removing linux-headers-6.11.0-8-generic (6.11.0-8.8) ... 146s Removing linux-headers-6.11.0-8 (6.11.0-8.8) ... 147s Removing linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 147s Processing triggers for libc-bin (2.41-1ubuntu1) ... 148s (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 ... 56328 files and directories currently installed.) 148s Purging configuration files for libpython3.12-minimal:s390x (3.12.9-1) ... 148s Purging configuration files for linux-modules-6.11.0-8-generic (6.11.0-8.8) ... 148s autopkgtest [18:06:15]: upgrading testbed (apt dist-upgrade and autopurge) 148s Reading package lists... 148s Building dependency tree... 148s Reading state information... 148s Calculating upgrade...Starting pkgProblemResolver with broken count: 0 148s Starting 2 pkgProblemResolver with broken count: 0 148s Done 148s Entering ResolveByKeep 149s 149s Calculating upgrade... 149s The following packages will be upgraded: 149s libc-bin libc-dev-bin libc6 libc6-dev locales 149s 5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 149s Need to get 9512 kB of archives. 149s After this operation, 8192 B of additional disk space will be used. 149s Get:1 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libc6-dev s390x 2.41-1ubuntu2 [1678 kB] 150s Get:2 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libc-dev-bin s390x 2.41-1ubuntu2 [24.3 kB] 150s Get:3 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libc6 s390x 2.41-1ubuntu2 [2892 kB] 153s Get:4 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x libc-bin s390x 2.41-1ubuntu2 [671 kB] 154s Get:5 http://ftpmaster.internal/ubuntu plucky-proposed/main s390x locales all 2.41-1ubuntu2 [4246 kB] 158s Preconfiguring packages ... 158s Fetched 9512 kB in 9s (1015 kB/s) 158s (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 ... 56326 files and directories currently installed.) 158s Preparing to unpack .../libc6-dev_2.41-1ubuntu2_s390x.deb ... 158s Unpacking libc6-dev:s390x (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 158s Preparing to unpack .../libc-dev-bin_2.41-1ubuntu2_s390x.deb ... 158s Unpacking libc-dev-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 158s Preparing to unpack .../libc6_2.41-1ubuntu2_s390x.deb ... 159s Unpacking libc6:s390x (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 159s Setting up libc6:s390x (2.41-1ubuntu2) ... 159s (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 ... 56326 files and directories currently installed.) 159s Preparing to unpack .../libc-bin_2.41-1ubuntu2_s390x.deb ... 159s Unpacking libc-bin (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 159s Setting up libc-bin (2.41-1ubuntu2) ... 159s (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 ... 56326 files and directories currently installed.) 159s Preparing to unpack .../locales_2.41-1ubuntu2_all.deb ... 159s Unpacking locales (2.41-1ubuntu2) over (2.41-1ubuntu1) ... 159s Setting up locales (2.41-1ubuntu2) ... 159s Generating locales (this might take a while)... 160s en_US.UTF-8... done 160s Generation complete. 160s Setting up libc-dev-bin (2.41-1ubuntu2) ... 160s Setting up libc6-dev:s390x (2.41-1ubuntu2) ... 160s Processing triggers for man-db (2.13.0-1) ... 161s Processing triggers for systemd (257.3-1ubuntu3) ... 162s Reading package lists... 162s Building dependency tree... 162s Reading state information... 162s Starting pkgProblemResolver with broken count: 0 162s Starting 2 pkgProblemResolver with broken count: 0 162s Done 162s Solving dependencies... 163s 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 163s autopkgtest [18:06:30]: rebooting testbed after setup commands that affected boot 181s autopkgtest [18:06:48]: testbed running kernel: Linux 6.14.0-10-generic #10-Ubuntu SMP Wed Mar 12 14:53:49 UTC 2025 183s autopkgtest [18:06:50]: @@@@@@@@@@@@@@@@@@@@ apt-source r-cran-git2r 185s Get:1 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (dsc) [2100 B] 185s Get:2 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (tar) [237 kB] 185s Get:3 http://ftpmaster.internal/ubuntu plucky/universe r-cran-git2r 0.35.0-1build1 (diff) [3100 B] 185s gpgv: Signature made Sat Feb 22 06:18:41 2025 UTC 185s gpgv: using RSA key 5C7ABEA20F8630459CC8C8B5E27F2CF8458C2FA4 185s gpgv: Can't check signature: No public key 185s dpkg-source: warning: cannot verify inline signature for ./r-cran-git2r_0.35.0-1build1.dsc: no acceptable signature found 185s autopkgtest [18:06:52]: testing package r-cran-git2r version 0.35.0-1build1 185s autopkgtest [18:06:52]: build not needed 189s autopkgtest [18:06:56]: test run-unit-test: preparing testbed 189s Reading package lists... 189s Building dependency tree... 189s Reading state information... 190s Starting pkgProblemResolver with broken count: 0 190s Starting 2 pkgProblemResolver with broken count: 0 190s Done 190s The following NEW packages will be installed: 190s fontconfig fontconfig-config fonts-dejavu-core fonts-dejavu-mono libblas3 190s libcairo2 libdatrie1 libdeflate0 libfontconfig1 libfreetype6 libgfortran5 190s libgit2-1.9 libgomp1 libgraphite2-3 libharfbuzz0b libice6 libjbig0 190s libjpeg-turbo8 libjpeg8 liblapack3 libpango-1.0-0 libpangocairo-1.0-0 190s libpangoft2-1.0-0 libpaper-utils libpaper2 libpixman-1-0 libsharpyuv0 libsm6 190s libtcl8.6 libthai-data libthai0 libtiff6 libtk8.6 libwebp7 libxcb-render0 190s libxcb-shm0 libxft2 libxrender1 libxss1 libxt6t64 r-base-core r-cran-git2r 190s unzip x11-common xdg-utils zip 190s 0 upgraded, 46 newly installed, 0 to remove and 0 not upgraded. 190s Need to get 41.1 MB of archives. 190s After this operation, 83.2 MB of additional disk space will be used. 190s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x libfreetype6 s390x 2.13.3+dfsg-1 [431 kB] 191s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-dejavu-mono all 2.37-8 [502 kB] 191s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x fonts-dejavu-core all 2.37-8 [835 kB] 192s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x fontconfig-config s390x 2.15.0-2ubuntu1 [37.5 kB] 192s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x libfontconfig1 s390x 2.15.0-2ubuntu1 [150 kB] 192s Get:6 http://ftpmaster.internal/ubuntu plucky/main s390x fontconfig s390x 2.15.0-2ubuntu1 [191 kB] 193s Get:7 http://ftpmaster.internal/ubuntu plucky/main s390x libblas3 s390x 3.12.1-2 [252 kB] 193s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x libpixman-1-0 s390x 0.44.0-3 [201 kB] 193s Get:9 http://ftpmaster.internal/ubuntu plucky/main s390x libxcb-render0 s390x 1.17.0-2 [17.0 kB] 193s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x libxcb-shm0 s390x 1.17.0-2 [5862 B] 193s Get:11 http://ftpmaster.internal/ubuntu plucky/main s390x libxrender1 s390x 1:0.9.10-1.1build1 [20.4 kB] 193s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x libcairo2 s390x 1.18.2-2 [580 kB] 193s Get:13 http://ftpmaster.internal/ubuntu plucky/main s390x libdatrie1 s390x 0.2.13-3build1 [20.6 kB] 193s Get:14 http://ftpmaster.internal/ubuntu plucky/main s390x libdeflate0 s390x 1.23-1 [46.1 kB] 193s Get:15 http://ftpmaster.internal/ubuntu plucky/main s390x libgfortran5 s390x 15-20250222-0ubuntu1 [620 kB] 194s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x libgit2-1.9 s390x 1.9.0+ds-1ubuntu1 [602 kB] 195s Get:17 http://ftpmaster.internal/ubuntu plucky/main s390x libgomp1 s390x 15-20250222-0ubuntu1 [152 kB] 195s Get:18 http://ftpmaster.internal/ubuntu plucky/main s390x libgraphite2-3 s390x 1.3.14-2ubuntu1 [79.8 kB] 195s Get:19 http://ftpmaster.internal/ubuntu plucky/main s390x libharfbuzz0b s390x 10.2.0-1 [538 kB] 195s Get:20 http://ftpmaster.internal/ubuntu plucky/main s390x x11-common all 1:7.7+23ubuntu3 [21.7 kB] 196s Get:21 http://ftpmaster.internal/ubuntu plucky/main s390x libice6 s390x 2:1.1.1-1 [45.4 kB] 196s Get:22 http://ftpmaster.internal/ubuntu plucky/main s390x libjpeg-turbo8 s390x 2.1.5-3ubuntu2 [147 kB] 196s Get:23 http://ftpmaster.internal/ubuntu plucky/main s390x libjpeg8 s390x 8c-2ubuntu11 [2146 B] 196s Get:24 http://ftpmaster.internal/ubuntu plucky/main s390x liblapack3 s390x 3.12.1-2 [2971 kB] 199s Get:25 http://ftpmaster.internal/ubuntu plucky/main s390x libthai-data all 0.1.29-2build1 [158 kB] 199s Get:26 http://ftpmaster.internal/ubuntu plucky/main s390x libthai0 s390x 0.1.29-2build1 [20.7 kB] 199s Get:27 http://ftpmaster.internal/ubuntu plucky/main s390x libpango-1.0-0 s390x 1.56.2-1 [253 kB] 199s Get:28 http://ftpmaster.internal/ubuntu plucky/main s390x libpangoft2-1.0-0 s390x 1.56.2-1 [50.2 kB] 199s Get:29 http://ftpmaster.internal/ubuntu plucky/main s390x libpangocairo-1.0-0 s390x 1.56.2-1 [28.2 kB] 199s Get:30 http://ftpmaster.internal/ubuntu plucky/main s390x libpaper2 s390x 2.2.5-0.3 [17.2 kB] 199s Get:31 http://ftpmaster.internal/ubuntu plucky/main s390x libpaper-utils s390x 2.2.5-0.3 [15.3 kB] 199s Get:32 http://ftpmaster.internal/ubuntu plucky/main s390x libsharpyuv0 s390x 1.5.0-0.1 [16.7 kB] 199s Get:33 http://ftpmaster.internal/ubuntu plucky/main s390x libsm6 s390x 2:1.2.4-1 [18.4 kB] 199s Get:34 http://ftpmaster.internal/ubuntu plucky/main s390x libtcl8.6 s390x 8.6.16+dfsg-1 [1034 kB] 200s Get:35 http://ftpmaster.internal/ubuntu plucky/main s390x libjbig0 s390x 2.1-6.1ubuntu2 [33.1 kB] 200s Get:36 http://ftpmaster.internal/ubuntu plucky/main s390x libwebp7 s390x 1.5.0-0.1 [210 kB] 200s Get:37 http://ftpmaster.internal/ubuntu plucky/main s390x libtiff6 s390x 4.5.1+git230720-4ubuntu4 [217 kB] 201s Get:38 http://ftpmaster.internal/ubuntu plucky/main s390x libxft2 s390x 2.3.6-1build1 [49.6 kB] 201s Get:39 http://ftpmaster.internal/ubuntu plucky/main s390x libxss1 s390x 1:1.2.3-1build3 [7396 B] 201s Get:40 http://ftpmaster.internal/ubuntu plucky/main s390x libtk8.6 s390x 8.6.16-1 [830 kB] 201s Get:41 http://ftpmaster.internal/ubuntu plucky/main s390x libxt6t64 s390x 1:1.2.1-1.2build1 [184 kB] 201s Get:42 http://ftpmaster.internal/ubuntu plucky/main s390x zip s390x 3.0-14ubuntu2 [187 kB] 202s Get:43 http://ftpmaster.internal/ubuntu plucky/main s390x unzip s390x 6.0-28ubuntu6 [186 kB] 202s Get:44 http://ftpmaster.internal/ubuntu plucky/main s390x xdg-utils all 1.2.1-2ubuntu1 [66.0 kB] 202s Get:45 http://ftpmaster.internal/ubuntu plucky/universe s390x r-base-core s390x 4.4.3-1 [28.6 MB] 232s Get:46 http://ftpmaster.internal/ubuntu plucky/universe s390x r-cran-git2r s390x 0.35.0-1build1 [444 kB] 233s Preconfiguring packages ... 233s Fetched 41.1 MB in 43s (955 kB/s) 233s Selecting previously unselected package libfreetype6:s390x. 233s (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 ... 56326 files and directories currently installed.) 233s Preparing to unpack .../00-libfreetype6_2.13.3+dfsg-1_s390x.deb ... 233s Unpacking libfreetype6:s390x (2.13.3+dfsg-1) ... 233s Selecting previously unselected package fonts-dejavu-mono. 233s Preparing to unpack .../01-fonts-dejavu-mono_2.37-8_all.deb ... 233s Unpacking fonts-dejavu-mono (2.37-8) ... 233s Selecting previously unselected package fonts-dejavu-core. 233s Preparing to unpack .../02-fonts-dejavu-core_2.37-8_all.deb ... 233s Unpacking fonts-dejavu-core (2.37-8) ... 233s Selecting previously unselected package fontconfig-config. 233s Preparing to unpack .../03-fontconfig-config_2.15.0-2ubuntu1_s390x.deb ... 233s Unpacking fontconfig-config (2.15.0-2ubuntu1) ... 233s Selecting previously unselected package libfontconfig1:s390x. 233s Preparing to unpack .../04-libfontconfig1_2.15.0-2ubuntu1_s390x.deb ... 233s Unpacking libfontconfig1:s390x (2.15.0-2ubuntu1) ... 233s Selecting previously unselected package fontconfig. 233s Preparing to unpack .../05-fontconfig_2.15.0-2ubuntu1_s390x.deb ... 233s Unpacking fontconfig (2.15.0-2ubuntu1) ... 233s Selecting previously unselected package libblas3:s390x. 233s Preparing to unpack .../06-libblas3_3.12.1-2_s390x.deb ... 233s Unpacking libblas3:s390x (3.12.1-2) ... 233s Selecting previously unselected package libpixman-1-0:s390x. 233s Preparing to unpack .../07-libpixman-1-0_0.44.0-3_s390x.deb ... 233s Unpacking libpixman-1-0:s390x (0.44.0-3) ... 233s Selecting previously unselected package libxcb-render0:s390x. 233s Preparing to unpack .../08-libxcb-render0_1.17.0-2_s390x.deb ... 233s Unpacking libxcb-render0:s390x (1.17.0-2) ... 233s Selecting previously unselected package libxcb-shm0:s390x. 233s Preparing to unpack .../09-libxcb-shm0_1.17.0-2_s390x.deb ... 233s Unpacking libxcb-shm0:s390x (1.17.0-2) ... 233s Selecting previously unselected package libxrender1:s390x. 233s Preparing to unpack .../10-libxrender1_1%3a0.9.10-1.1build1_s390x.deb ... 233s Unpacking libxrender1:s390x (1:0.9.10-1.1build1) ... 233s Selecting previously unselected package libcairo2:s390x. 233s Preparing to unpack .../11-libcairo2_1.18.2-2_s390x.deb ... 233s Unpacking libcairo2:s390x (1.18.2-2) ... 233s Selecting previously unselected package libdatrie1:s390x. 233s Preparing to unpack .../12-libdatrie1_0.2.13-3build1_s390x.deb ... 233s Unpacking libdatrie1:s390x (0.2.13-3build1) ... 233s Selecting previously unselected package libdeflate0:s390x. 233s Preparing to unpack .../13-libdeflate0_1.23-1_s390x.deb ... 233s Unpacking libdeflate0:s390x (1.23-1) ... 234s Selecting previously unselected package libgfortran5:s390x. 234s Preparing to unpack .../14-libgfortran5_15-20250222-0ubuntu1_s390x.deb ... 234s Unpacking libgfortran5:s390x (15-20250222-0ubuntu1) ... 234s Selecting previously unselected package libgit2-1.9:s390x. 234s Preparing to unpack .../15-libgit2-1.9_1.9.0+ds-1ubuntu1_s390x.deb ... 234s Unpacking libgit2-1.9:s390x (1.9.0+ds-1ubuntu1) ... 234s Selecting previously unselected package libgomp1:s390x. 234s Preparing to unpack .../16-libgomp1_15-20250222-0ubuntu1_s390x.deb ... 234s Unpacking libgomp1:s390x (15-20250222-0ubuntu1) ... 234s Selecting previously unselected package libgraphite2-3:s390x. 234s Preparing to unpack .../17-libgraphite2-3_1.3.14-2ubuntu1_s390x.deb ... 234s Unpacking libgraphite2-3:s390x (1.3.14-2ubuntu1) ... 234s Selecting previously unselected package libharfbuzz0b:s390x. 234s Preparing to unpack .../18-libharfbuzz0b_10.2.0-1_s390x.deb ... 234s Unpacking libharfbuzz0b:s390x (10.2.0-1) ... 234s Selecting previously unselected package x11-common. 234s Preparing to unpack .../19-x11-common_1%3a7.7+23ubuntu3_all.deb ... 234s Unpacking x11-common (1:7.7+23ubuntu3) ... 234s Selecting previously unselected package libice6:s390x. 234s Preparing to unpack .../20-libice6_2%3a1.1.1-1_s390x.deb ... 234s Unpacking libice6:s390x (2:1.1.1-1) ... 234s Selecting previously unselected package libjpeg-turbo8:s390x. 234s Preparing to unpack .../21-libjpeg-turbo8_2.1.5-3ubuntu2_s390x.deb ... 234s Unpacking libjpeg-turbo8:s390x (2.1.5-3ubuntu2) ... 234s Selecting previously unselected package libjpeg8:s390x. 234s Preparing to unpack .../22-libjpeg8_8c-2ubuntu11_s390x.deb ... 234s Unpacking libjpeg8:s390x (8c-2ubuntu11) ... 234s Selecting previously unselected package liblapack3:s390x. 234s Preparing to unpack .../23-liblapack3_3.12.1-2_s390x.deb ... 234s Unpacking liblapack3:s390x (3.12.1-2) ... 234s Selecting previously unselected package libthai-data. 234s Preparing to unpack .../24-libthai-data_0.1.29-2build1_all.deb ... 234s Unpacking libthai-data (0.1.29-2build1) ... 234s Selecting previously unselected package libthai0:s390x. 234s Preparing to unpack .../25-libthai0_0.1.29-2build1_s390x.deb ... 234s Unpacking libthai0:s390x (0.1.29-2build1) ... 234s Selecting previously unselected package libpango-1.0-0:s390x. 234s Preparing to unpack .../26-libpango-1.0-0_1.56.2-1_s390x.deb ... 234s Unpacking libpango-1.0-0:s390x (1.56.2-1) ... 234s Selecting previously unselected package libpangoft2-1.0-0:s390x. 234s Preparing to unpack .../27-libpangoft2-1.0-0_1.56.2-1_s390x.deb ... 234s Unpacking libpangoft2-1.0-0:s390x (1.56.2-1) ... 234s Selecting previously unselected package libpangocairo-1.0-0:s390x. 234s Preparing to unpack .../28-libpangocairo-1.0-0_1.56.2-1_s390x.deb ... 234s Unpacking libpangocairo-1.0-0:s390x (1.56.2-1) ... 234s Selecting previously unselected package libpaper2:s390x. 234s Preparing to unpack .../29-libpaper2_2.2.5-0.3_s390x.deb ... 234s Unpacking libpaper2:s390x (2.2.5-0.3) ... 234s Selecting previously unselected package libpaper-utils. 234s Preparing to unpack .../30-libpaper-utils_2.2.5-0.3_s390x.deb ... 234s Unpacking libpaper-utils (2.2.5-0.3) ... 234s Selecting previously unselected package libsharpyuv0:s390x. 234s Preparing to unpack .../31-libsharpyuv0_1.5.0-0.1_s390x.deb ... 234s Unpacking libsharpyuv0:s390x (1.5.0-0.1) ... 234s Selecting previously unselected package libsm6:s390x. 234s Preparing to unpack .../32-libsm6_2%3a1.2.4-1_s390x.deb ... 234s Unpacking libsm6:s390x (2:1.2.4-1) ... 234s Selecting previously unselected package libtcl8.6:s390x. 234s Preparing to unpack .../33-libtcl8.6_8.6.16+dfsg-1_s390x.deb ... 234s Unpacking libtcl8.6:s390x (8.6.16+dfsg-1) ... 234s Selecting previously unselected package libjbig0:s390x. 234s Preparing to unpack .../34-libjbig0_2.1-6.1ubuntu2_s390x.deb ... 234s Unpacking libjbig0:s390x (2.1-6.1ubuntu2) ... 234s Selecting previously unselected package libwebp7:s390x. 234s Preparing to unpack .../35-libwebp7_1.5.0-0.1_s390x.deb ... 234s Unpacking libwebp7:s390x (1.5.0-0.1) ... 234s Selecting previously unselected package libtiff6:s390x. 234s Preparing to unpack .../36-libtiff6_4.5.1+git230720-4ubuntu4_s390x.deb ... 234s Unpacking libtiff6:s390x (4.5.1+git230720-4ubuntu4) ... 234s Selecting previously unselected package libxft2:s390x. 234s Preparing to unpack .../37-libxft2_2.3.6-1build1_s390x.deb ... 234s Unpacking libxft2:s390x (2.3.6-1build1) ... 234s Selecting previously unselected package libxss1:s390x. 234s Preparing to unpack .../38-libxss1_1%3a1.2.3-1build3_s390x.deb ... 234s Unpacking libxss1:s390x (1:1.2.3-1build3) ... 234s Selecting previously unselected package libtk8.6:s390x. 234s Preparing to unpack .../39-libtk8.6_8.6.16-1_s390x.deb ... 234s Unpacking libtk8.6:s390x (8.6.16-1) ... 234s Selecting previously unselected package libxt6t64:s390x. 234s Preparing to unpack .../40-libxt6t64_1%3a1.2.1-1.2build1_s390x.deb ... 234s Unpacking libxt6t64:s390x (1:1.2.1-1.2build1) ... 234s Selecting previously unselected package zip. 234s Preparing to unpack .../41-zip_3.0-14ubuntu2_s390x.deb ... 234s Unpacking zip (3.0-14ubuntu2) ... 234s Selecting previously unselected package unzip. 234s Preparing to unpack .../42-unzip_6.0-28ubuntu6_s390x.deb ... 234s Unpacking unzip (6.0-28ubuntu6) ... 234s Selecting previously unselected package xdg-utils. 234s Preparing to unpack .../43-xdg-utils_1.2.1-2ubuntu1_all.deb ... 234s Unpacking xdg-utils (1.2.1-2ubuntu1) ... 234s Selecting previously unselected package r-base-core. 234s Preparing to unpack .../44-r-base-core_4.4.3-1_s390x.deb ... 234s Unpacking r-base-core (4.4.3-1) ... 234s Selecting previously unselected package r-cran-git2r. 234s Preparing to unpack .../45-r-cran-git2r_0.35.0-1build1_s390x.deb ... 234s Unpacking r-cran-git2r (0.35.0-1build1) ... 234s Setting up libgraphite2-3:s390x (1.3.14-2ubuntu1) ... 234s Setting up libpixman-1-0:s390x (0.44.0-3) ... 234s Setting up libsharpyuv0:s390x (1.5.0-0.1) ... 234s Setting up libxrender1:s390x (1:0.9.10-1.1build1) ... 234s Setting up libdatrie1:s390x (0.2.13-3build1) ... 234s Setting up libxcb-render0:s390x (1.17.0-2) ... 234s Setting up unzip (6.0-28ubuntu6) ... 234s Setting up x11-common (1:7.7+23ubuntu3) ... 234s Setting up libdeflate0:s390x (1.23-1) ... 234s Setting up libxcb-shm0:s390x (1.17.0-2) ... 234s Setting up libgomp1:s390x (15-20250222-0ubuntu1) ... 234s Setting up libjbig0:s390x (2.1-6.1ubuntu2) ... 234s Setting up zip (3.0-14ubuntu2) ... 234s Setting up libblas3:s390x (3.12.1-2) ... 234s update-alternatives: using /usr/lib/s390x-linux-gnu/blas/libblas.so.3 to provide /usr/lib/s390x-linux-gnu/libblas.so.3 (libblas.so.3-s390x-linux-gnu) in auto mode 234s Setting up libfreetype6:s390x (2.13.3+dfsg-1) ... 234s Setting up fonts-dejavu-mono (2.37-8) ... 234s Setting up libtcl8.6:s390x (8.6.16+dfsg-1) ... 234s Setting up fonts-dejavu-core (2.37-8) ... 234s Setting up libjpeg-turbo8:s390x (2.1.5-3ubuntu2) ... 234s Setting up libgit2-1.9:s390x (1.9.0+ds-1ubuntu1) ... 234s Setting up libgfortran5:s390x (15-20250222-0ubuntu1) ... 234s Setting up libwebp7:s390x (1.5.0-0.1) ... 235s Setting up libharfbuzz0b:s390x (10.2.0-1) ... 235s Setting up libthai-data (0.1.29-2build1) ... 235s Setting up libxss1:s390x (1:1.2.3-1build3) ... 235s Setting up libpaper2:s390x (2.2.5-0.3) ... 235s Setting up xdg-utils (1.2.1-2ubuntu1) ... 235s update-alternatives: using /usr/bin/xdg-open to provide /usr/bin/open (open) in auto mode 235s Setting up libjpeg8:s390x (8c-2ubuntu11) ... 235s Setting up libice6:s390x (2:1.1.1-1) ... 235s Setting up liblapack3:s390x (3.12.1-2) ... 235s update-alternatives: using /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3 to provide /usr/lib/s390x-linux-gnu/liblapack.so.3 (liblapack.so.3-s390x-linux-gnu) in auto mode 235s Setting up fontconfig-config (2.15.0-2ubuntu1) ... 235s Setting up libpaper-utils (2.2.5-0.3) ... 235s Setting up libthai0:s390x (0.1.29-2build1) ... 235s Setting up libtiff6:s390x (4.5.1+git230720-4ubuntu4) ... 235s Setting up libfontconfig1:s390x (2.15.0-2ubuntu1) ... 235s Setting up libsm6:s390x (2:1.2.4-1) ... 235s Setting up fontconfig (2.15.0-2ubuntu1) ... 237s Regenerating fonts cache... done. 237s Setting up libxft2:s390x (2.3.6-1build1) ... 237s Setting up libtk8.6:s390x (8.6.16-1) ... 237s Setting up libpango-1.0-0:s390x (1.56.2-1) ... 237s Setting up libcairo2:s390x (1.18.2-2) ... 237s Setting up libxt6t64:s390x (1:1.2.1-1.2build1) ... 237s Setting up libpangoft2-1.0-0:s390x (1.56.2-1) ... 237s Setting up libpangocairo-1.0-0:s390x (1.56.2-1) ... 237s Setting up r-base-core (4.4.3-1) ... 237s Creating config file /etc/R/Renviron with new version 237s Setting up r-cran-git2r (0.35.0-1build1) ... 237s Processing triggers for man-db (2.13.0-1) ... 238s Processing triggers for install-info (7.1.1-1) ... 238s Processing triggers for libc-bin (2.41-1ubuntu2) ... 239s autopkgtest [18:07:46]: test run-unit-test: [----------------------- 239s BEGIN TEST add-force.R 239s 239s R version 4.4.3 (2025-02-28) -- "Trophy Case" 239s Copyright (C) 2025 The R Foundation for Statistical Computing 239s Platform: s390x-ibm-linux-gnu 239s 239s R is free software and comes with ABSOLUTELY NO WARRANTY. 239s You are welcome to redistribute it under certain conditions. 239s Type 'license()' or 'licence()' for distribution details. 239s 239s R is a collaborative project with many contributors. 239s Type 'contributors()' for more information and 239s 'citation()' on how to cite R or R packages in publications. 239s 239s Type 'demo()' for some demos, 'help()' for on-line help, or 239s 'help.start()' for an HTML browser interface to help. 239s Type 'q()' to quit R. 239s 239s > ## git2r, R bindings to the libgit2 library. 239s > ## Copyright (C) 2013-2023 The git2r contributors 239s > ## 239s > ## This program is free software; you can redistribute it and/or modify 239s > ## it under the terms of the GNU General Public License, version 2, 239s > ## as published by the Free Software Foundation. 239s > ## 239s > ## git2r is distributed in the hope that it will be useful, 239s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 239s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 239s > ## GNU General Public License for more details. 239s > ## 239s > ## You should have received a copy of the GNU General Public License along 239s > ## with this program; if not, write to the Free Software Foundation, Inc., 239s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 239s > 239s > library(git2r) 239s > source("util/check.R") 239s > 239s > ## For debugging 239s > sessionInfo() 239s R version 4.4.3 (2025-02-28) 239s Platform: s390x-ibm-linux-gnu 239s Running under: Ubuntu Plucky Puffin (development branch) 239s 239s Matrix products: default 239s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 239s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 239s 239s locale: 239s [1] C 239s 239s time zone: Etc/UTC 239s tzcode source: system (glibc) 239s 239s attached base packages: 239s [1] stats graphics grDevices utils datasets methods base 239s 239s other attached packages: 239s [1] git2r_0.35.0 239s 239s loaded via a namespace (and not attached): 239s [1] compiler_4.4.3 239s > libgit2_version() 239s $major 239s [1] 1 239s 239s $minor 239s [1] 9 239s 239s $rev 239s [1] 0 239s 239s > libgit2_features() 239s $threads 239s [1] TRUE 239s 239s $https 239s [1] TRUE 239s 239s $ssh 239s [1] TRUE 239s 239s > 239s > ## Create a directory in tempdir 239s > path <- tempfile(pattern = "git2r-") 239s > dir.create(path) 239s > 239s > ## Initialize a repository 239s > repo <- init(path) 239s > config(repo, user.name = "Alice", user.email = "alice@example.org") 239s > 239s > ## Create a '.gitignore' file 239s > writeLines("test.txt", file.path(path, ".gitignore")) 239s > add(repo, ".gitignore") 239s > commit(repo, "First commit message") 239s [9db370c] 2025-03-15: First commit message 239s > 239s > ## Create a file 239s > writeLines("Hello world!", file.path(path, "test.txt")) 239s > 239s > ## Check status 239s > s_1 <- structure(list(staged = empty_named_list(), 239s + unstaged = empty_named_list(), 239s + untracked = empty_named_list(), 239s + ignored = list(ignored = "test.txt")), 239s + class = "git_status") 239s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 239s > 239s > ## The file is ignored and should not be added 239s > add(repo, "test.txt") 239s > stopifnot(identical(status(repo, ignored = TRUE), s_1)) 239s > 239s > ## The file is ignored but should be added with force 239s > s_2 <- structure(list(staged = list(new = "test.txt"), 239s + unstaged = empty_named_list(), 239s + untracked = empty_named_list(), 239s + ignored = empty_named_list()), 239s + class = "git_status") 239s > 239s > add(repo, "test.txt", force = TRUE) 239s > stopifnot(identical(status(repo, ignored = TRUE), s_2)) 239s > 239s > ## Commit and check status 239s > s_3 <- structure(list(staged = empty_named_list(), 239s + unstaged = empty_named_list(), 239s + untracked = empty_named_list(), 239s + ignored = empty_named_list()), 239s + class = "git_status") 239s > 239s > commit(repo, "Second commit message") 239s [7403469] 2025-03-15: Second commit message 239s > stopifnot(identical(status(repo, ignored = TRUE), s_3)) 239s > 239s > ## Cleanup 239s > unlink(path, recursive = TRUE) 239s > 239s BEGIN TEST bare_repository.R 239s 239s R version 4.4.3 (2025-02-28) -- "Trophy Case" 239s Copyright (C) 2025 The R Foundation for Statistical Computing 239s Platform: s390x-ibm-linux-gnu 239s 239s R is free software and comes with ABSOLUTELY NO WARRANTY. 239s You are welcome to redistribute it under certain conditions. 239s Type 'license()' or 'licence()' for distribution details. 239s 239s R is a collaborative project with many contributors. 239s Type 'contributors()' for more information and 239s 'citation()' on how to cite R or R packages in publications. 239s 239s Type 'demo()' for some demos, 'help()' for on-line help, or 239s 'help.start()' for an HTML browser interface to help. 239s Type 'q()' to quit R. 239s 239s > ## git2r, R bindings to the libgit2 library. 239s > ## Copyright (C) 2013-2023 The git2r contributors 239s > ## 239s > ## This program is free software; you can redistribute it and/or modify 239s > ## it under the terms of the GNU General Public License, version 2, 239s > ## as published by the Free Software Foundation. 239s > ## 239s > ## git2r is distributed in the hope that it will be useful, 239s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 239s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 239s > ## GNU General Public License for more details. 239s > ## 239s > ## You should have received a copy of the GNU General Public License along 239s > ## with this program; if not, write to the Free Software Foundation, Inc., 239s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 239s > 239s > library("git2r") 239s > 239s > ## For debugging 239s > sessionInfo() 239s R version 4.4.3 (2025-02-28) 239s Platform: s390x-ibm-linux-gnu 239s Running under: Ubuntu Plucky Puffin (development branch) 239s 239s Matrix products: default 239s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 239s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 239s 239s locale: 239s [1] C 239s 239s time zone: Etc/UTC 239s tzcode source: system (glibc) 239s 239s attached base packages: 239s [1] stats graphics grDevices utils datasets methods base 239s 239s other attached packages: 239s [1] git2r_0.35.0 239s 239s loaded via a namespace (and not attached): 239s [1] compiler_4.4.3 239s > libgit2_version() 239s $major 239s [1] 1 239s 239s $minor 239s [1] 9 239s 239s $rev 239s [1] 0 239s 239s > libgit2_features() 239s $threads 239s [1] TRUE 239s 239s $https 239s [1] TRUE 239s 239s $ssh 239s [1] TRUE 239s 239s > 239s > 239s > ## Create a directory in tempdir 239s > path <- tempfile(pattern = "git2r-") 239s > dir.create(path) 239s > 239s > ## Initialize a bare repository 239s > repo <- init(path, bare = TRUE) 239s > 239s > ## Check that the state of the repository 239s > stopifnot(identical(is_bare(repo), TRUE)) 239s > stopifnot(identical(is_empty(repo), TRUE)) 239s > 239s > ## Check that workdir is NULL for a bare repository 239s > stopifnot(is.null(workdir(repo))) 239s > 239s > ## Check with missing repo argument 239s > setwd(path) 239s > stopifnot(identical(is_bare(), TRUE)) 239s > 239s > ## Cleanup 239s > unlink(path, recursive = TRUE) 239s > 239s BEGIN TEST blame.R 239s sh: 0: getcwd() failed: No such file or directory 239s 239s R version 4.4.3 (2025-02-28) -- "Trophy Case" 239s Copyright (C) 2025 The R Foundation for Statistical Computing 239s Platform: s390x-ibm-linux-gnu 239s 239s R is free software and comes with ABSOLUTELY NO WARRANTY. 239s You are welcome to redistribute it under certain conditions. 239s Type 'license()' or 'licence()' for distribution details. 239s 239s R is a collaborative project with many contributors. 239s Type 'contributors()' for more information and 239s 'citation()' on how to cite R or R packages in publications. 239s 239s Type 'demo()' for some demos, 'help()' for on-line help, or 239s 'help.start()' for an HTML browser interface to help. 239s Type 'q()' to quit R. 239s 239s > ## git2r, R bindings to the libgit2 library. 239s > ## Copyright (C) 2013-2023 The git2r contributors 239s > ## 239s > ## This program is free software; you can redistribute it and/or modify 239s > ## it under the terms of the GNU General Public License, version 2, 239s > ## as published by the Free Software Foundation. 239s > ## 239s > ## git2r is distributed in the hope that it will be useful, 239s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 239s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 239s > ## GNU General Public License for more details. 239s > ## 239s > ## You should have received a copy of the GNU General Public License along 239s > ## with this program; if not, write to the Free Software Foundation, Inc., 239s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 239s > 239s > library(git2r) 239s > 239s > ## For debugging 239s > sessionInfo() 239s R version 4.4.3 (2025-02-28) 239s Platform: s390x-ibm-linux-gnu 239s Running under: Ubuntu Plucky Puffin (development branch) 239s 239s Matrix products: default 239s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 239s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 239s 239s locale: 239s [1] C 239s 239s time zone: Etc/UTC 239s tzcode source: system (glibc) 239s 239s attached base packages: 239s [1] stats graphics grDevices utils datasets methods base 239s 239s other attached packages: 239s [1] git2r_0.35.0 239s 239s loaded via a namespace (and not attached): 239s [1] compiler_4.4.3 239s > libgit2_version() 239s $major 239s [1] 1 239s 239s $minor 239s [1] 9 239s 239s $rev 239s [1] 0 239s 239s > libgit2_features() 239s $threads 239s [1] TRUE 239s 239s $https 239s [1] TRUE 239s 239s $ssh 239s [1] TRUE 239s 239s > 239s > 239s > ## Create a directory in tempdir 239s > path <- tempfile(pattern = "git2r-") 239s > dir.create(path) 239s > 239s > ## Initialize a repository 239s > repo <- init(path) 239s > config(repo, user.name = "Alice", user.email = "alice@example.org") 239s > 239s > ## Create a file and commit 239s > writeLines("Hello world!", file.path(path, "test.txt")) 239s > add(repo, "test.txt") 239s > commit_1 <- commit(repo, "First commit message") 239s > 239s > ## Create new user and change file 239s > config(repo, user.name = "Bob", user.email = "bob@example.org") 239s > writeLines(c("Hello world!", "HELLO WORLD!", "HOLA"), 239s + file.path(path, "test.txt")) 239s > add(repo, "test.txt") 239s > commit_2 <- commit(repo, "Second commit message") 239s > 239s > ## Check blame 239s > b <- blame(repo, "test.txt") 239s > stopifnot(identical(length(b$hunks), 2L)) 239s > 239s > ## Hunk: 1 239s > stopifnot(identical(b$hunks[[1]]$lines_in_hunk, 1L)) 239s > stopifnot(identical(b$hunks[[1]]$final_commit_id, sha(commit_1))) 239s > stopifnot(identical(b$hunks[[1]]$final_start_line_number, 1L)) 239s > stopifnot(identical(b$hunks[[1]]$final_signature$name, "Alice")) 239s > stopifnot(identical(b$hunks[[1]]$final_signature$email, "alice@example.org")) 239s > stopifnot(identical(b$hunks[[1]]$orig_commit_id, sha(commit_1))) 239s > stopifnot(identical(b$hunks[[1]]$orig_start_line_number, 1L)) 239s > stopifnot(identical(b$hunks[[1]]$orig_signature$name, "Alice")) 239s > stopifnot(identical(b$hunks[[1]]$orig_signature$email, "alice@example.org")) 239s > stopifnot(identical(b$hunks[[1]]$orig_path, "test.txt")) 239s > stopifnot(identical(b$hunks[[1]]$boundary, TRUE)) 239s > 239s > ## Hunk: 2 239s > stopifnot(identical(b$hunks[[2]]$lines_in_hunk, 2L)) 239s > stopifnot(identical(b$hunks[[2]]$final_commit_id, sha(commit_2))) 239s > stopifnot(identical(b$hunks[[2]]$final_start_line_number, 2L)) 239s > stopifnot(identical(b$hunks[[2]]$final_signature$name, "Bob")) 239s > stopifnot(identical(b$hunks[[2]]$final_signature$email, "bob@example.org")) 239s > stopifnot(identical(b$hunks[[2]]$orig_commit_id, sha(commit_2))) 239s > stopifnot(identical(b$hunks[[2]]$orig_start_line_number, 2L)) 239s > stopifnot(identical(b$hunks[[2]]$orig_signature$name, "Bob")) 239s > stopifnot(identical(b$hunks[[2]]$orig_signature$email, "bob@example.org")) 239s > stopifnot(identical(b$hunks[[2]]$orig_path, "test.txt")) 239s > stopifnot(identical(b$hunks[[2]]$boundary, FALSE)) 239s > 239s > ## Cleanup 239s > unlink(path, recursive = TRUE) 239s > 239s BEGIN TEST blob.R 239s 239s R version 4.4.3 (2025-02-28) -- "Trophy Case" 239s Copyright (C) 2025 The R Foundation for Statistical Computing 239s Platform: s390x-ibm-linux-gnu 239s 239s R is free software and comes with ABSOLUTELY NO WARRANTY. 239s You are welcome to redistribute it under certain conditions. 239s Type 'license()' or 'licence()' for distribution details. 239s 239s R is a collaborative project with many contributors. 239s Type 'contributors()' for more information and 239s 'citation()' on how to cite R or R packages in publications. 239s 239s Type 'demo()' for some demos, 'help()' for on-line help, or 239s 'help.start()' for an HTML browser interface to help. 239s Type 'q()' to quit R. 239s 239s > ## git2r, R bindings to the libgit2 library. 239s > ## Copyright (C) 2013-2023 The git2r contributors 239s > ## 239s > ## This program is free software; you can redistribute it and/or modify 239s > ## it under the terms of the GNU General Public License, version 2, 239s > ## as published by the Free Software Foundation. 239s > ## 239s > ## git2r is distributed in the hope that it will be useful, 239s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 239s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 239s > ## GNU General Public License for more details. 239s > ## 239s > ## You should have received a copy of the GNU General Public License along 239s > ## with this program; if not, write to the Free Software Foundation, Inc., 239s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 239s > 239s > library(git2r) 239s > library(tools) 240s > source("util/check.R") 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] tools stats graphics grDevices utils datasets methods 240s [8] base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(path) 240s > 240s > ## Initialize a repository 240s > repo <- init(path) 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create a file 240s > f <- file(file.path(path, "test.txt"), "wb") 240s > writeChar("Hello world!\n", f, eos = NULL) 240s > close(f) 240s > 240s > ## add and commit 240s > add(repo, "test.txt") 240s > new_commit <- commit(repo, "Commit message") 240s > 240s > ## Lookup blob 240s > blob <- lookup(repo, "cd0875583aabe89ee197ea133980a9085d08e497") 240s > stopifnot(isTRUE(is_blob(blob))) 240s > stopifnot(identical(sha(blob), "cd0875583aabe89ee197ea133980a9085d08e497")) 240s > stopifnot(identical(is_binary(blob), FALSE)) 240s > stopifnot(identical(blob, lookup(repo, "cd0875"))) 240s > stopifnot(identical(length(blob), 13L)) 240s > stopifnot(identical(content(blob), "Hello world!")) 240s > stopifnot(identical(print(blob), blob)) 240s blob: cd0875583aabe89ee197ea133980a9085d08e497 240s size: 13 bytes 240s > 240s > ## Add one more commit 240s > f <- file(file.path(path, "test.txt"), "wb") 240s > writeChar("Hello world!\nHELLO WORLD!\nHeLlO wOrLd!\n", f, eos = NULL) 240s > close(f) 240s > add(repo, "test.txt") 240s > blob <- lookup(repo, tree(commit(repo, "New commit message"))$id[1]) 240s > stopifnot(identical(content(blob), 240s + c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"))) 240s > stopifnot(identical(rawToChar(content(blob, raw = TRUE)), 240s + content(blob, split = FALSE))) 240s > 240s > ## Check content of binary file 240s > set.seed(42) 240s > x <- as.raw((sample(0:255, 1000, replace = TRUE))) 240s > writeBin(x, con = file.path(path, "test.bin")) 240s > add(repo, "test.bin") 240s > commit(repo, "Add binary file") 240s [ab60f13] 2025-03-15: Add binary file 240s > blob <- tree(last_commit(repo))["test.bin"] 240s > stopifnot(identical(content(blob), NA_character_)) 240s > stopifnot(identical(x, content(blob, raw = TRUE))) 240s > 240s > ## Hash 240s > stopifnot(identical(hash("Hello, world!\n"), 240s + "af5626b4a114abcb82d63db7c8082c3c4756e51b")) 240s > stopifnot(identical(hash("test content\n"), 240s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4")) 240s > stopifnot(identical(hash(c("Hello, world!\n", 240s + "test content\n")), 240s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 240s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 240s > stopifnot(identical(hash(c("Hello, world!\n", 240s + NA_character_, 240s + "test content\n")), 240s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 240s + NA_character_, 240s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 240s > stopifnot(identical(hash(character(0)), character(0))) 240s > 240s > ## Hash file 240s > test_1_txt <- file(file.path(path, "test-1.txt"), "wb") 240s > writeChar("Hello, world!\n", test_1_txt, eos = NULL) 240s > close(test_1_txt) 240s > test_2_txt <- file(file.path(path, "test-2.txt"), "wb") 240s > writeChar("test content\n", test_2_txt, eos = NULL) 240s > close(test_2_txt) 240s > stopifnot(identical(hash("Hello, world!\n"), 240s + hashfile(file.path(path, "test-1.txt")))) 240s > stopifnot(identical(hash("test content\n"), 240s + hashfile(file.path(path, "test-2.txt")))) 240s > stopifnot(identical(hash(c("Hello, world!\n", 240s + "test content\n")), 240s + hashfile(c(file.path(path, "test-1.txt"), 240s + file.path(path, "test-2.txt"))))) 240s > assertError(hashfile(c(file.path(path, "test-1.txt"), 240s + NA_character_, 240s + file.path(path, "test-2.txt")))) 240s > stopifnot(identical(hashfile(character(0)), character(0))) 240s > 240s > ## Create blob from disk 240s > tmp_file_1 <- tempfile() 240s > tmp_file_2 <- tempfile() 240s > f1 <- file(tmp_file_1, "wb") 240s > writeChar("Hello, world!\n", f1, eos = NULL) 240s > close(f1) 240s > f2 <- file(tmp_file_2, "wb") 240s > writeChar("test content\n", f2, eos = NULL) 240s > close(f2) 240s > blob_list_1 <- blob_create(repo, c(tmp_file_1, tmp_file_2), relative = FALSE) 240s > unlink(tmp_file_1) 240s > unlink(tmp_file_2) 240s > stopifnot(identical(sapply(blob_list_1, "[[", "sha"), 240s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 240s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 240s > 240s > ## Create blob from workdir 240s > tmp_file_3 <- file.path(path, "test-workdir-1.txt") 240s > tmp_file_4 <- file.path(path, "test-workdir-2.txt") 240s > f3 <- file(tmp_file_3, "wb") 240s > writeChar("Hello, world!\n", f3, eos = NULL) 240s > close(f3) 240s > f4 <- file(tmp_file_4, "wb") 240s > writeChar("test content\n", f4, eos = NULL) 240s > close(f4) 240s > blob_list_2 <- blob_create(repo, c("test-workdir-1.txt", 240s + "test-workdir-2.txt")) 240s > stopifnot(identical(sapply(blob_list_2, "[[", "sha"), 240s + c("af5626b4a114abcb82d63db7c8082c3c4756e51b", 240s + "d670460b4b4aece5915caf5c68d12f560a9fe3e4"))) 240s > 240s > ## Test arguments 240s > check_error(assertError(.Call(git2r:::git2r_blob_content, NULL, FALSE)), 240s + "'blob' must be an S3 class git_blob") 240s > check_error(assertError(.Call(git2r:::git2r_blob_content, 3, FALSE)), 240s + "'blob' must be an S3 class git_blob") 240s > check_error(assertError(.Call(git2r:::git2r_blob_content, repo, FALSE)), 240s + "'blob' must be an S3 class git_blob") 240s > 240s > b <- blob_list_1[[1]] 240s > b$sha <- NA_character_ 240s > check_error(assertError(.Call(git2r:::git2r_blob_content, b, FALSE)), 240s + "'blob' must be an S3 class git_blob") 240s > 240s > check_error(assertError(hashfile(NA)), "invalid 'path' argument") 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s BEGIN TEST branch.R 240s 240s R version 4.4.3 (2025-02-28) -- "Trophy Case" 240s Copyright (C) 2025 The R Foundation for Statistical Computing 240s Platform: s390x-ibm-linux-gnu 240s 240s R is free software and comes with ABSOLUTELY NO WARRANTY. 240s You are welcome to redistribute it under certain conditions. 240s Type 'license()' or 'licence()' for distribution details. 240s 240s R is a collaborative project with many contributors. 240s Type 'contributors()' for more information and 240s 'citation()' on how to cite R or R packages in publications. 240s 240s Type 'demo()' for some demos, 'help()' for on-line help, or 240s 'help.start()' for an HTML browser interface to help. 240s Type 'q()' to quit R. 240s 240s > ## git2r, R bindings to the libgit2 library. 240s > ## Copyright (C) 2013-2023 The git2r contributors 240s > ## 240s > ## This program is free software; you can redistribute it and/or modify 240s > ## it under the terms of the GNU General Public License, version 2, 240s > ## as published by the Free Software Foundation. 240s > ## 240s > ## git2r is distributed in the hope that it will be useful, 240s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 240s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 240s > ## GNU General Public License for more details. 240s > ## 240s > ## You should have received a copy of the GNU General Public License along 240s > ## with this program; if not, write to the Free Software Foundation, Inc., 240s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 240s > 240s > library(git2r) 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] stats graphics grDevices utils datasets methods base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(path) 240s > 240s > ## Initialize a repository 240s > repo <- init(path, branch = "main") 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create a file 240s > writeLines("Hello world!", file.path(path, "test.txt")) 240s > 240s > ## add and commit 240s > add(repo, "test.txt") 240s > commit_1 <- commit(repo, "Commit message") 240s > 240s > ## Check branch 240s > stopifnot(identical(length(branches(repo)), 1L)) 240s > stopifnot(identical(is_head(branches(repo)[[1]]), TRUE)) 240s > stopifnot(identical(is_local(branches(repo)[[1]]), TRUE)) 240s > stopifnot(identical(branches(repo)[[1]]$name, "main")) 240s > stopifnot(identical(branches(repo)[[1]], repository_head(repo))) 240s > stopifnot(identical(branches(repo)$main, repository_head(repo))) 240s > 240s > ## Check branch argument 240s > res <- tools::assertError(is_local(1)) 240s > stopifnot(length(grep("argument 'branch' must be a 'git_branch' object", 240s + res[[1]]$message)) > 0) 240s > 240s > ## Check branch name argument 240s > res <- tools::assertError(branch_set_upstream()) 240s > stopifnot(length(grep("Missing argument name", 240s + res[[1]]$message)) > 0) 240s > 240s > ## Print branch 240s > b <- repository_head(repo) 240s > stopifnot(identical(print(b), b)) 240s [801994] (Local) (HEAD) main 240s > 240s > ## Create a branch 240s > b <- branch_create(commit_1, name = "test") 240s > stopifnot(identical(b$name, "test")) 240s > stopifnot(identical(b$type, 1L)) 240s > stopifnot(identical(sha(b), branch_target(b))) 240s > stopifnot(identical(length(branches(repo)), 2L)) 240s > stopifnot(identical(branch_target(branches(repo)[[1]]), 240s + branch_target(branches(repo)[[2]]))) 240s > 240s > ## Check is_branch 240s > stopifnot(identical(is_branch(b), TRUE)) 240s > stopifnot(identical(is_branch(5), FALSE)) 240s > 240s > ## Add one more commit 240s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 240s > add(repo, "test.txt") 240s > commit_2 <- commit(repo, "Another commit message") 240s > 240s > ## Now the first branch should have moved on 240s > stopifnot(!identical(branch_target(branches(repo)[[1]]), 240s + branch_target(branches(repo)[[2]]))) 240s > 240s > ## Create a branch with the same name should fail 240s > tools::assertError(branch_create(commit_2, name = "test")) 240s > 240s > ## Force it and check the branches are identical again 240s > b <- branch_create(commit_2, name = "test", force = TRUE) 240s > stopifnot(identical(branch_target(branches(repo)[[1]]), 240s + branch_target(branches(repo)[[2]]))) 240s > 240s > ## Test arguments 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, NULL)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, 3)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, repo)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > b_tmp <- b 240s > b_tmp$name <- NA_character_ 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > b_tmp <- b 240s > b_tmp$type <- NA_integer_ 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > b_tmp$type <- 3L 240s > res <- tools::assertError(.Call(git2r:::git2r_branch_delete, b_tmp)) 240s > stopifnot(length(grep("'branch' must be an S3 class git_branch", 240s + res[[1]]$message)) > 0) 240s > 240s > ## Delete branch 240s > branch_delete(b) 240s > stopifnot(identical(length(branches(repo)), 1L)) 240s > 240s > ## Add one more commit 240s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world"), 240s + file.path(path, "test.txt")) 240s > add(repo, "test.txt") 240s > commit_3 <- commit(repo, "Another third commit message") 240s > 240s > ## Create and test renaming of branches 240s > b_1 <- branch_create(commit_1, name = "test-1") 240s > b_2 <- branch_create(commit_2, name = "test-2") 240s > b_3 <- branch_create(commit_3, name = "test-3") 240s > stopifnot(identical(length(branches(repo)), 4L)) 240s > b_1 <- branch_rename(b_1, name = "test-1-new-name") 240s > stopifnot(identical(length(branches(repo)), 4L)) 240s > stopifnot(identical(b_1$name, "test-1-new-name")) 240s > tools::assertError(branch_rename(b_1, name = "test-2")) 240s > branch_rename(b_1, name = "test-2", force = TRUE) 240s > stopifnot(identical(length(branches(repo)), 3L)) 240s > 240s > ## Check branches method with missing repo argument 240s > wd <- setwd(path) 240s > stopifnot(identical(length(branches()), 3L)) 240s > if (!is.null(wd)) 240s + setwd(wd) 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s BEGIN TEST bundle.R 240s 240s R version 4.4.3 (2025-02-28) -- "Trophy Case" 240s Copyright (C) 2025 The R Foundation for Statistical Computing 240s Platform: s390x-ibm-linux-gnu 240s 240s R is free software and comes with ABSOLUTELY NO WARRANTY. 240s You are welcome to redistribute it under certain conditions. 240s Type 'license()' or 'licence()' for distribution details. 240s 240s R is a collaborative project with many contributors. 240s Type 'contributors()' for more information and 240s 'citation()' on how to cite R or R packages in publications. 240s 240s Type 'demo()' for some demos, 'help()' for on-line help, or 240s 'help.start()' for an HTML browser interface to help. 240s Type 'q()' to quit R. 240s 240s > ## git2r, R bindings to the libgit2 library. 240s > ## Copyright (C) 2013-2023 The git2r contributors 240s > ## 240s > ## This program is free software; you can redistribute it and/or modify 240s > ## it under the terms of the GNU General Public License, version 2, 240s > ## as published by the Free Software Foundation. 240s > ## 240s > ## git2r is distributed in the hope that it will be useful, 240s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 240s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 240s > ## GNU General Public License for more details. 240s > ## 240s > ## You should have received a copy of the GNU General Public License along 240s > ## with this program; if not, write to the Free Software Foundation, Inc., 240s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 240s > 240s > library("git2r") 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] stats graphics grDevices utils datasets methods base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(file.path(path, "bundle", "R"), recursive = TRUE) 240s > 240s > ## Initialize a repository 240s > repo <- init(file.path(path, "bundle")) 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create a DESCRIPTION file 240s > writeLines(c( 240s + "package: bundle", 240s + "Title: Bundle Git Repository", 240s + "Description: Bundle a bare repository of the code in the 'inst' folder.", 240s + "Version: 0.1", 240s + "License: GPL-2", 240s + "Authors@R: person('Alice', role = c('aut', 'cre'),", 240s + " email = 'alice@example.org')"), 240s + con = file.path(path, "bundle", "DESCRIPTION")) 240s > add(repo, file.path(path, "bundle", "DESCRIPTION")) 240s > commit(repo, "Add DESCRIPTION file") 240s [1d27218] 2025-03-15: Add DESCRIPTION file 240s > 240s > ## Create R file 240s > writeLines("f <- function(x, y) x+y", 240s + con = file.path(path, "bundle", "R", "bundle.R")) 240s > add(repo, file.path(path, "bundle", "R", "bundle.R")) 240s > commit(repo, "Add R file") 240s [14b8194] 2025-03-15: Add R file 240s > 240s > ## Bundle package 240s > bundle_r_package(repo) 240s cloning into '/tmp/RtmpS54TKZ/git2r-931384b86f0/bundle/inst/bundle.git'... 240s > 240s > ## Fails if bundled package exists 240s > tools::assertError(bundle_r_package(repo)) 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s BEGIN TEST checkout-named-branch.R 240s 240s R version 4.4.3 (2025-02-28) -- "Trophy Case" 240s Copyright (C) 2025 The R Foundation for Statistical Computing 240s Platform: s390x-ibm-linux-gnu 240s 240s R is free software and comes with ABSOLUTELY NO WARRANTY. 240s You are welcome to redistribute it under certain conditions. 240s Type 'license()' or 'licence()' for distribution details. 240s 240s R is a collaborative project with many contributors. 240s Type 'contributors()' for more information and 240s 'citation()' on how to cite R or R packages in publications. 240s 240s Type 'demo()' for some demos, 'help()' for on-line help, or 240s 'help.start()' for an HTML browser interface to help. 240s Type 'q()' to quit R. 240s 240s > ## git2r, R bindings to the libgit2 library. 240s > ## Copyright (C) 2013-2023 The git2r contributors 240s > ## 240s > ## This program is free software; you can redistribute it and/or modify 240s > ## it under the terms of the GNU General Public License, version 2, 240s > ## as published by the Free Software Foundation. 240s > ## 240s > ## git2r is distributed in the hope that it will be useful, 240s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 240s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 240s > ## GNU General Public License for more details. 240s > ## 240s > ## You should have received a copy of the GNU General Public License along 240s > ## with this program; if not, write to the Free Software Foundation, Inc., 240s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 240s > 240s > library(git2r) 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] stats graphics grDevices utils datasets methods base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create directories for repositories in tempdir 240s > path_bare <- tempfile(pattern = "git2r-") 240s > path_repo_1 <- tempfile(pattern = "git2r-") 240s > path_repo_2 <- tempfile(pattern = "git2r-") 240s > 240s > dir.create(path_bare) 240s > dir.create(path_repo_1) 240s > dir.create(path_repo_2) 240s > 240s > ## Create bare repository 240s > bare_repo <- init(path_bare, bare = TRUE) 240s > 240s > ## Clone to repo 1 240s > repo_1 <- clone(path_bare, path_repo_1) 240s cloning into '/tmp/RtmpkohS81/git2r-93d49ff8833'... 240s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Add changes to repo 1 and push to bare 240s > writeLines( 240s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 240s + con = file.path(path_repo_1, "test.txt")) 240s > add(repo_1, "test.txt") 240s > commit(repo_1, "First commit message") 240s [c73484a] 2025-03-15: First commit message 240s > branch_name <- branches(repo_1)[[1]]$name 240s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 240s > 240s > ## Test checkout branch argument 240s > tools::assertError(checkout(repo_1)) 240s > tools::assertError(checkout(repo_1, c("master", "master"))) 240s > tools::assertError(checkout(repo_1, "dev")) 240s > 240s > ## Create and checkout dev branch in repo 1 240s > checkout(repo_1, "dev", create = TRUE) 240s > 240s > ## Add changes to dev branch in repo 1 and push to bare 240s > writeLines( 240s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 240s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 240s + con = file.path(path_repo_1, "test.txt")) 240s > add(repo_1, "test.txt") 240s > commit(repo_1, "Second commit message") 240s [261e3a4] 2025-03-15: Second commit message 240s > push(repo_1, "origin", "refs/heads/dev") 240s > 240s > ## Clone to repo 2 240s > repo_2 <- clone(path_bare, path_repo_2) 240s cloning into '/tmp/RtmpkohS81/git2r-93d367afec5'... 240s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 240s > 240s > stopifnot(identical( 240s + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 240s + readLines(file.path(path_repo_2, "test.txt")))) 240s > 240s > ## Checkout dev branch 240s > checkout(repo_2, "dev") 240s > 240s > ## Check content of file 240s > stopifnot(identical( 240s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 240s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 240s + readLines(file.path(path_repo_2, "test.txt")))) 240s > 240s > ## Checkout previous branch 240s > checkout(repo_2, "-") 240s > stopifnot(identical(repository_head(repo_2)$name, branch_name)) 240s > 240s > ## Cleanup 240s > unlink(path_bare, recursive = TRUE) 240s > unlink(path_repo_1, recursive = TRUE) 240s > unlink(path_repo_2, recursive = TRUE) 240s > 240s BEGIN TEST checkout.R 240s 240s R version 4.4.3 (2025-02-28) -- "Trophy Case" 240s Copyright (C) 2025 The R Foundation for Statistical Computing 240s Platform: s390x-ibm-linux-gnu 240s 240s R is free software and comes with ABSOLUTELY NO WARRANTY. 240s You are welcome to redistribute it under certain conditions. 240s Type 'license()' or 'licence()' for distribution details. 240s 240s R is a collaborative project with many contributors. 240s Type 'contributors()' for more information and 240s 'citation()' on how to cite R or R packages in publications. 240s 240s Type 'demo()' for some demos, 'help()' for on-line help, or 240s 'help.start()' for an HTML browser interface to help. 240s Type 'q()' to quit R. 240s 240s > ## git2r, R bindings to the libgit2 library. 240s > ## Copyright (C) 2013-2023 The git2r contributors 240s > ## 240s > ## This program is free software; you can redistribute it and/or modify 240s > ## it under the terms of the GNU General Public License, version 2, 240s > ## as published by the Free Software Foundation. 240s > ## 240s > ## git2r is distributed in the hope that it will be useful, 240s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 240s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 240s > ## GNU General Public License for more details. 240s > ## 240s > ## You should have received a copy of the GNU General Public License along 240s > ## with this program; if not, write to the Free Software Foundation, Inc., 240s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 240s > 240s > library(git2r) 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] stats graphics grDevices utils datasets methods base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(path) 240s > 240s > ## Initialize a repository 240s > repo <- init(path, branch = "main") 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create first commit 240s > writeLines("Hello world!", file.path(path, "test.txt")) 240s > add(repo, "test.txt") 240s > commit_1 <- commit(repo, "First commit message") 240s > 240s > ## Edit file and checkout 240s > writeLines(c("Hello world!", "Hello world!"), file.path(path, "test.txt")) 240s > status_exp_1 <- structure(list(staged = structure(list(), 240s + .Names = character(0)), 240s + unstaged = structure(list(modified = "test.txt"), 240s + .Names = "modified"), 240s + untracked = structure(list(), 240s + .Names = character(0))), 240s + .Names = c("staged", "unstaged", "untracked"), 240s + class = "git_status") 240s > status_obs_1 <- status(repo) 240s > str(status_exp_1) 240s List of 3 240s $ staged : Named list() 240s $ unstaged :List of 1 240s ..$ modified: chr "test.txt" 240s $ untracked: Named list() 240s - attr(*, "class")= chr "git_status" 240s > str(status_obs_1) 240s List of 3 240s $ staged : Named list() 240s $ unstaged :List of 1 240s ..$ modified: chr "test.txt" 240s $ untracked: Named list() 240s - attr(*, "class")= chr "git_status" 240s > stopifnot(identical(status_obs_1, status_exp_1)) 240s > checkout(repo, path = "test.txt") 240s > status_exp_2 <- structure(list(staged = structure(list(), 240s + .Names = character(0)), 240s + unstaged = structure(list(), 240s + .Names = character(0)), 240s + untracked = structure(list(), 240s + .Names = character(0))), 240s + .Names = c("staged", "unstaged", "untracked"), 240s + class = "git_status") 240s > status_obs_2 <- status(repo) 240s > str(status_exp_2) 240s List of 3 240s $ staged : Named list() 240s $ unstaged : Named list() 240s $ untracked: Named list() 240s - attr(*, "class")= chr "git_status" 240s > str(status_obs_2) 240s List of 3 240s $ staged : Named list() 240s $ unstaged : Named list() 240s $ untracked: Named list() 240s - attr(*, "class")= chr "git_status" 240s > stopifnot(identical(status_obs_2, status_exp_2)) 240s > 240s > ## Create second commit 240s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 240s > add(repo, "test.txt") 240s > commit_2 <- commit(repo, "Second commit message") 240s > tag(repo, "commit_2", "Tag message") 240s > 240s > ## Create third commit 240s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 240s + file.path(path, "test.txt")) 240s > add(repo, "test.txt") 240s > commit_3 <- commit(repo, "Third commit message") 240s > 240s > ## Check HEAD 240s > stopifnot(identical(is_detached(repo), FALSE)) 240s > stopifnot(identical(repository_head(repo)$name, "main")) 240s > 240s > ## Check show and summary 240s > repo 240s Local: main /tmp/Rtmpk40CBH/git2r-94916595722 240s Head: [6a1cb83] 2025-03-15: Third commit message 240s > summary(repo) 240s Local: main /tmp/Rtmpk40CBH/git2r-94916595722 240s Head: [6a1cb83] 2025-03-15: Third commit message 240s 240s Branches: 1 240s Tags: 1 240s Commits: 3 240s Contributors: 1 240s Stashes: 0 240s Ignored files: 0 240s Untracked files: 0 240s Unstaged files: 0 240s Staged files: 0 240s 240s Latest commits: 240s [6a1cb83] 2025-03-15: Third commit message 240s [bee0cf6] 2025-03-15: Second commit message 240s [2ed5ab3] 2025-03-15: First commit message 240s > 240s > ## Checkout first commit 240s > checkout(commit_1, TRUE) 240s > stopifnot(identical(is_detached(repo), TRUE)) 240s > stopifnot(identical(repository_head(repo), commit_1)) 240s > stopifnot(identical(readLines(file.path(path, "test.txt")), "Hello world!")) 240s > 240s > ## Check show and summary 240s > repo 240s Local: (detached) /tmp/Rtmpk40CBH/git2r-94916595722 240s Head: [2ed5ab3] 2025-03-15: First commit message 240s > summary(repo) 240s Local: (detached) /tmp/Rtmpk40CBH/git2r-94916595722 240s Head: [2ed5ab3] 2025-03-15: First commit message 240s 240s Branches: 1 240s Tags: 1 240s Commits: 1 240s Contributors: 1 240s Stashes: 0 240s Ignored files: 0 240s Untracked files: 0 240s Unstaged files: 0 240s Staged files: 0 240s 240s Latest commits: 240s [2ed5ab3] 2025-03-15: First commit message 240s > 240s > ## Checkout tag 240s > checkout(tags(repo)[[1]], TRUE) 240s > stopifnot(identical(is_detached(repo), TRUE)) 240s > stopifnot(identical(readLines(file.path(path, "test.txt")), 240s + c("Hello world!", "HELLO WORLD!"))) 240s > 240s > ## Check is_detached with missing repo argument 240s > wd <- setwd(path) 240s > stopifnot(identical(is_detached(), TRUE)) 240s > if (!is.null(wd)) 240s + setwd(wd) 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s BEGIN TEST checkout_branch.R 240s 240s R version 4.4.3 (2025-02-28) -- "Trophy Case" 240s Copyright (C) 2025 The R Foundation for Statistical Computing 240s Platform: s390x-ibm-linux-gnu 240s 240s R is free software and comes with ABSOLUTELY NO WARRANTY. 240s You are welcome to redistribute it under certain conditions. 240s Type 'license()' or 'licence()' for distribution details. 240s 240s R is a collaborative project with many contributors. 240s Type 'contributors()' for more information and 240s 'citation()' on how to cite R or R packages in publications. 240s 240s Type 'demo()' for some demos, 'help()' for on-line help, or 240s 'help.start()' for an HTML browser interface to help. 240s Type 'q()' to quit R. 240s 240s > ## git2r, R bindings to the libgit2 library. 240s > ## Copyright (C) 2013-2023 The git2r contributors 240s > ## 240s > ## This program is free software; you can redistribute it and/or modify 240s > ## it under the terms of the GNU General Public License, version 2, 240s > ## as published by the Free Software Foundation. 240s > ## 240s > ## git2r is distributed in the hope that it will be useful, 240s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 240s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 240s > ## GNU General Public License for more details. 240s > ## 240s > ## You should have received a copy of the GNU General Public License along 240s > ## with this program; if not, write to the Free Software Foundation, Inc., 240s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 240s > 240s > library(git2r) 240s > 240s > ## For debugging 240s > sessionInfo() 240s R version 4.4.3 (2025-02-28) 240s Platform: s390x-ibm-linux-gnu 240s Running under: Ubuntu Plucky Puffin (development branch) 240s 240s Matrix products: default 240s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 240s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 240s 240s locale: 240s [1] C 240s 240s time zone: Etc/UTC 240s tzcode source: system (glibc) 240s 240s attached base packages: 240s [1] stats graphics grDevices utils datasets methods base 240s 240s other attached packages: 240s [1] git2r_0.35.0 240s 240s loaded via a namespace (and not attached): 240s [1] compiler_4.4.3 240s > libgit2_version() 240s $major 240s [1] 1 240s 240s $minor 240s [1] 9 240s 240s $rev 240s [1] 0 240s 240s > libgit2_features() 240s $threads 240s [1] TRUE 240s 240s $https 240s [1] TRUE 240s 240s $ssh 240s [1] TRUE 240s 240s > 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(path) 240s > 240s > ## Initialize a repository 240s > repo <- init(path, branch = "main") 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create first commit 240s > writeLines("Hello world!", file.path(path, "test-1.txt")) 240s > add(repo, "test-1.txt") 240s > commit(repo, "First commit message") 240s [886e5be] 2025-03-15: First commit message 240s > 240s > ## Create and checkout dev branch in repo 240s > checkout(repo, "dev", create = TRUE) 240s > 240s > ## Create second commit 240s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 240s > add(repo, "test-2.txt") 240s > commit(repo, "Second commit message") 240s [b1cc8c4] 2025-03-15: Second commit message 240s > 240s > ## Check files 240s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 240s > 240s > ## Checkout master branch and check files 240s > checkout(repo, "main") 240s > stopifnot(identical(list.files(path), "test-1.txt")) 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s > ## Checkout branch in empty repository 240s > 240s > ## Create a directory in tempdir 240s > path <- tempfile(pattern = "git2r-") 240s > dir.create(path) 240s > 240s > ## Initialize a repository 240s > repo <- init(path) 240s > config(repo, user.name = "Alice", user.email = "alice@example.org") 240s > 240s > ## Create and checkout dev branch in repo 240s > checkout(repo, "dev", create = TRUE) 240s > 240s > ## Create first commit 240s > writeLines("Hello world!", file.path(path, "test-1.txt")) 240s > add(repo, "test-1.txt") 240s > commit(repo, "First commit message") 240s [886e5be] 2025-03-15: First commit message 240s > 240s > stopifnot(identical(length(branches(repo)), 1L)) 240s > stopifnot(identical(branches(repo)[[1]]$name, "dev")) 240s > 240s > ## Cleanup 240s > unlink(path, recursive = TRUE) 240s > 240s BEGIN TEST checkout_commit.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 241s > ## git2r, R bindings to the libgit2 library. 241s > ## Copyright (C) 2013-2023 The git2r contributors 241s > ## 241s > ## This program is free software; you can redistribute it and/or modify 241s > ## it under the terms of the GNU General Public License, version 2, 241s > ## as published by the Free Software Foundation. 241s > ## 241s > ## git2r is distributed in the hope that it will be useful, 241s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 241s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 241s > ## GNU General Public License for more details. 241s > ## 241s > ## You should have received a copy of the GNU General Public License along 241s > ## with this program; if not, write to the Free Software Foundation, Inc., 241s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 241s > 241s > library("git2r") 241s > 241s > ## For debugging 241s > sessionInfo() 241s R version 4.4.3 (2025-02-28) 241s Platform: s390x-ibm-linux-gnu 241s Running under: Ubuntu Plucky Puffin (development branch) 241s 241s Matrix products: default 241s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 241s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 241s 241s locale: 241s [1] C 241s 241s time zone: Etc/UTC 241s tzcode source: system (glibc) 241s 241s attached base packages: 241s [1] stats graphics grDevices utils datasets methods base 241s 241s other attached packages: 241s [1] git2r_0.35.0 241s 241s loaded via a namespace (and not attached): 241s [1] compiler_4.4.3 241s > libgit2_version() 241s $major 241s [1] 1 241s 241s $minor 241s [1] 9 241s 241s $rev 241s [1] 0 241s 241s > libgit2_features() 241s $threads 241s [1] TRUE 241s 241s $https 241s [1] TRUE 241s 241s $ssh 241s [1] TRUE 241s 241s > 241s > 241s > ## Create a directory in tempdir 241s > path <- tempfile(pattern = "git2r-") 241s > dir.create(path) 241s > 241s > ## Initialize a repository 241s > repo <- init(path) 241s > config(repo, user.name = "Alice", user.email = "alice@example.org") 241s > 241s > ## Create first commit 241s > writeLines("Hello world!", file.path(path, "test-1.txt")) 241s > add(repo, "test-1.txt") 241s > commit_1 <- commit(repo, "First commit message") 241s > 241s > ## Create and checkout dev branch in repo 241s > checkout(repo, "dev", create = TRUE) 241s > 241s > ## Create second commit 241s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 241s > add(repo, "test-2.txt") 241s > commit_2 <- commit(repo, "Second commit message") 241s > 241s > ## Check files 241s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 241s > 241s > ## Checkout commit_1 and check files 241s > checkout(commit_1) 241s > stopifnot(identical(list.files(path), "test-1.txt")) 241s > 241s > ## Checkout commit_2 and check files 241s > checkout(commit_2) 241s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 241s > 241s > ## Cleanup 241s > unlink(path, recursive = TRUE) 241s > 241s BEGIN TEST checkout_tag.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 241s > ## git2r, R bindings to the libgit2 library. 241s > ## Copyright (C) 2013-2023 The git2r contributors 241s > ## 241s > ## This program is free software; you can redistribute it and/or modify 241s > ## it under the terms of the GNU General Public License, version 2, 241s > ## as published by the Free Software Foundation. 241s > ## 241s > ## git2r is distributed in the hope that it will be useful, 241s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 241s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 241s > ## GNU General Public License for more details. 241s > ## 241s > ## You should have received a copy of the GNU General Public License along 241s > ## with this program; if not, write to the Free Software Foundation, Inc., 241s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 241s > 241s > library(git2r) 241s > 241s > ## For debugging 241s > sessionInfo() 241s R version 4.4.3 (2025-02-28) 241s Platform: s390x-ibm-linux-gnu 241s Running under: Ubuntu Plucky Puffin (development branch) 241s 241s Matrix products: default 241s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 241s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 241s 241s locale: 241s [1] C 241s 241s time zone: Etc/UTC 241s tzcode source: system (glibc) 241s 241s attached base packages: 241s [1] stats graphics grDevices utils datasets methods base 241s 241s other attached packages: 241s [1] git2r_0.35.0 241s 241s loaded via a namespace (and not attached): 241s [1] compiler_4.4.3 241s > libgit2_version() 241s $major 241s [1] 1 241s 241s $minor 241s [1] 9 241s 241s $rev 241s [1] 0 241s 241s > libgit2_features() 241s $threads 241s [1] TRUE 241s 241s $https 241s [1] TRUE 241s 241s $ssh 241s [1] TRUE 241s 241s > 241s > 241s > ## Create a directory in tempdir 241s > path <- tempfile(pattern = "git2r-") 241s > dir.create(path) 241s > 241s > ## Initialize a repository 241s > repo <- init(path) 241s > config(repo, user.name = "Alice", user.email = "alice@example.org") 241s > 241s > ## Create first commit 241s > writeLines("Hello world!", file.path(path, "test-1.txt")) 241s > add(repo, "test-1.txt") 241s > commit_1 <- commit(repo, "First commit message") 241s > tag_1 <- tag(repo, "Tag1", "First tag message") 241s > 241s > ## Create and checkout dev branch in repo 241s > checkout(repo, "dev", create = TRUE) 241s > 241s > ## Create second commit 241s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-2.txt")) 241s > add(repo, "test-2.txt") 241s > commit_2 <- commit(repo, "Second commit message") 241s > tag_2 <- tag(repo, "Tag2", "Second tag message") 241s > 241s > ## Check files 241s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 241s > 241s > ## Checkout tag_1 and check files 241s > checkout(tag_1) 241s > stopifnot(identical(list.files(path), "test-1.txt")) 241s > 241s > ## Checkout tag_2 and check files 241s > checkout(tag_2) 241s > stopifnot(identical(list.files(path), c("test-1.txt", "test-2.txt"))) 241s > 241s > ## Checkout "Tag1" and check files 241s > checkout(repo, "Tag1") 241s > stopifnot(identical(list.files(path), "test-1.txt")) 241s > 241s > ## Cleanup 241s > unlink(path, recursive = TRUE) 241s > 241s BEGIN TEST clone_bare.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 241s > ## git2r, R bindings to the libgit2 library. 241s > ## Copyright (C) 2013-2023 The git2r contributors 241s > ## 241s > ## This program is free software; you can redistribute it and/or modify 241s > ## it under the terms of the GNU General Public License, version 2, 241s > ## as published by the Free Software Foundation. 241s > ## 241s > ## git2r is distributed in the hope that it will be useful, 241s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 241s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 241s > ## GNU General Public License for more details. 241s > ## 241s > ## You should have received a copy of the GNU General Public License along 241s > ## with this program; if not, write to the Free Software Foundation, Inc., 241s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 241s > 241s > library("git2r") 241s > 241s > ## For debugging 241s > sessionInfo() 241s R version 4.4.3 (2025-02-28) 241s Platform: s390x-ibm-linux-gnu 241s Running under: Ubuntu Plucky Puffin (development branch) 241s 241s Matrix products: default 241s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 241s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 241s 241s locale: 241s [1] C 241s 241s time zone: Etc/UTC 241s tzcode source: system (glibc) 241s 241s attached base packages: 241s [1] stats graphics grDevices utils datasets methods base 241s 241s other attached packages: 241s [1] git2r_0.35.0 241s 241s loaded via a namespace (and not attached): 241s [1] compiler_4.4.3 241s > libgit2_version() 241s $major 241s [1] 1 241s 241s $minor 241s [1] 9 241s 241s $rev 241s [1] 0 241s 241s > libgit2_features() 241s $threads 241s [1] TRUE 241s 241s $https 241s [1] TRUE 241s 241s $ssh 241s [1] TRUE 241s 241s > 241s > 241s > ## Create 2 directories in tempdir 241s > path_bare <- tempfile(pattern = "git2r-") 241s > path_repo <- tempfile(pattern = "git2r-") 241s > dir.create(path_bare) 241s > dir.create(path_repo) 241s > 241s > ## Initialize a repository 241s > repo <- init(path_repo) 241s > config(repo, user.name = "Alice", user.email = "alice@example.org") 241s > 241s > ## Add commit to repo 241s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 241s > add(repo, "test.txt") 241s > commit_1 <- commit(repo, "Commit message") 241s > 241s > ## Check bare argument 241s > tools::assertError(clone(path_repo, path_bare, bare = c(TRUE, TRUE))) 241s > tools::assertError(clone(path_repo, path_bare, bare = 1)) 241s > tools::assertError(clone(path_repo, path_bare, bare = 1L)) 241s > tools::assertError(clone(path_repo, path_bare, bare = "test")) 241s > 241s > ## Clone repo to bare repository 241s > bare_repo <- clone(path_repo, path_bare, bare = TRUE) 241s cloning into '/tmp/RtmpV4x9pS/git2r-97954b38f50'... 241s > 241s > ## Check the repositores 241s > stopifnot(identical(is_bare(bare_repo), TRUE)) 241s > stopifnot(identical(is_bare(repo), FALSE)) 241s > 241s > ## Check result in bare repository 241s > stopifnot(identical(length(commits(bare_repo)), 1L)) 241s > bare_commit_1 <- commits(bare_repo)[[1]] 241s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 241s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 241s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 241s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 241s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 241s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 241s > 241s > ## Cleanup 241s > unlink(path_bare, recursive = TRUE) 241s > unlink(path_repo, recursive = TRUE) 241s > 241s BEGIN TEST clone_branch.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 241s > ## git2r, R bindings to the libgit2 library. 241s > ## Copyright (C) 2013-2023 The git2r contributors 241s > ## 241s > ## This program is free software; you can redistribute it and/or modify 241s > ## it under the terms of the GNU General Public License, version 2, 241s > ## as published by the Free Software Foundation. 241s > ## 241s > ## git2r is distributed in the hope that it will be useful, 241s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 241s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 241s > ## GNU General Public License for more details. 241s > ## 241s > ## You should have received a copy of the GNU General Public License along 241s > ## with this program; if not, write to the Free Software Foundation, Inc., 241s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 241s > 241s > library(git2r) 241s > 241s > ## For debugging 241s > sessionInfo() 241s R version 4.4.3 (2025-02-28) 241s Platform: s390x-ibm-linux-gnu 241s Running under: Ubuntu Plucky Puffin (development branch) 241s 241s Matrix products: default 241s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 241s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 241s 241s locale: 241s [1] C 241s 241s time zone: Etc/UTC 241s tzcode source: system (glibc) 241s 241s attached base packages: 241s [1] stats graphics grDevices utils datasets methods base 241s 241s other attached packages: 241s [1] git2r_0.35.0 241s 241s loaded via a namespace (and not attached): 241s [1] compiler_4.4.3 241s > libgit2_version() 241s $major 241s [1] 1 241s 241s $minor 241s [1] 9 241s 241s $rev 241s [1] 0 241s 241s > libgit2_features() 241s $threads 241s [1] TRUE 241s 241s $https 241s [1] TRUE 241s 241s $ssh 241s [1] TRUE 241s 241s > 241s > 241s > ## Create directories for repositories in tempdir 241s > path_bare <- tempfile(pattern = "git2r-") 241s > path_repo_1 <- tempfile(pattern = "git2r-") 241s > path_repo_2 <- tempfile(pattern = "git2r-") 241s > 241s > dir.create(path_bare) 241s > dir.create(path_repo_1) 241s > dir.create(path_repo_2) 241s > 241s > ## Create bare repository 241s > bare_repo <- init(path_bare, bare = TRUE) 241s > 241s > ## Clone to repo 1 241s > repo_1 <- clone(path_bare, path_repo_1) 241s cloning into '/tmp/RtmpA79tMC/git2r-985220b5b85'... 241s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 241s > 241s > ## Add changes to repo 1 241s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 241s + con = file.path(path_repo_1, "test-1.txt")) 241s > add(repo_1, "test-1.txt") 241s > commit_1 <- commit(repo_1, "First commit message") 241s > branch_name <- branches(repo_1)[[1]]$name 241s > 241s > ## Create 'dev' branch 241s > checkout(branch_create(commit_1, name = "dev")) 241s > 241s > ## Add more changes to repo 1 241s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 241s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 241s + con = file.path(path_repo_1, "test-1.txt")) 241s > add(repo_1, "test-1.txt") 241s > commit(repo_1, "Second commit message") 241s [702c8dd] 2025-03-15: Second commit message 241s > 241s > ## Add more changes to repo 1 241s > writeLines( 241s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 241s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 241s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 241s + con = file.path(path_repo_1, "test-1.txt")) 241s > add(repo_1, "test-1.txt") 241s > commit(repo_1, "Third commit message") 241s [37c5e5a] 2025-03-15: Third commit message 241s > 241s > ## Push to bare 241s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 241s > push(repo_1, "origin", "refs/heads/dev") 241s > 241s > ## Print branch 241s > branches(repo_1)[[paste0("origin/", branch_name)]] 241s [d46c53] (origin @ /tmp/RtmpA79tMC/git2r-9856152c809) master 241s > 241s > ## Clone to repo 2 241s > repo_2 <- clone(url = path_bare, local_path = path_repo_2, branch = "dev") 241s cloning into '/tmp/RtmpA79tMC/git2r-9857420c4fd'... 241s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 241s > 241s > ## Check branch and commits 241s > stopifnot(identical(length(commits(repo_2)), 3L)) 241s > stopifnot(identical(repository_head(repo_2)$name, "dev")) 241s > 241s > ## Cleanup 241s > unlink(path_bare, recursive = TRUE) 241s > unlink(path_repo_1, recursive = TRUE) 241s > unlink(path_repo_2, recursive = TRUE) 241s > 241s BEGIN TEST clone_checkout.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 241s > ## git2r, R bindings to the libgit2 library. 241s > ## Copyright (C) 2013-2023 The git2r contributors 241s > ## 241s > ## This program is free software; you can redistribute it and/or modify 241s > ## it under the terms of the GNU General Public License, version 2, 241s > ## as published by the Free Software Foundation. 241s > ## 241s > ## git2r is distributed in the hope that it will be useful, 241s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 241s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 241s > ## GNU General Public License for more details. 241s > ## 241s > ## You should have received a copy of the GNU General Public License along 241s > ## with this program; if not, write to the Free Software Foundation, Inc., 241s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 241s > 241s > library("git2r") 241s > 241s > ## For debugging 241s > sessionInfo() 241s R version 4.4.3 (2025-02-28) 241s Platform: s390x-ibm-linux-gnu 241s Running under: Ubuntu Plucky Puffin (development branch) 241s 241s Matrix products: default 241s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 241s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 241s 241s locale: 241s [1] C 241s 241s time zone: Etc/UTC 241s tzcode source: system (glibc) 241s 241s attached base packages: 241s [1] stats graphics grDevices utils datasets methods base 241s 241s other attached packages: 241s [1] git2r_0.35.0 241s 241s loaded via a namespace (and not attached): 241s [1] compiler_4.4.3 241s > libgit2_version() 241s $major 241s [1] 1 241s 241s $minor 241s [1] 9 241s 241s $rev 241s [1] 0 241s 241s > libgit2_features() 241s $threads 241s [1] TRUE 241s 241s $https 241s [1] TRUE 241s 241s $ssh 241s [1] TRUE 241s 241s > 241s > 241s > ## Create 2 directories in tempdir 241s > path_src <- tempfile(pattern = "git2r-") 241s > path_tgt <- tempfile(pattern = "git2r-") 241s > dir.create(path_tgt) 241s > dir.create(path_src) 241s > 241s > ## Initialize a repository 241s > repo_src <- init(path_src) 241s > config(repo_src, user.name = "Alice", user.email = "alice@example.org") 241s > 241s > ## Add commit to repo 241s > filename <- "test.txt" 241s > writeLines("Hello world", con = file.path(path_src, filename)) 241s > add(repo_src, "test.txt") 241s > commit_src <- commit(repo_src, "Commit message") 241s > 241s > ## Check checkout argument 241s > tools::assertError(clone(path_src, path_tgt, checkout = c(FALSE, TRUE))) 241s > tools::assertError(clone(path_src, path_tgt, checkout = 1)) 241s > tools::assertError(clone(path_src, path_tgt, checkout = 1L)) 241s > tools::assertError(clone(path_src, path_tgt, checkout = "test")) 241s > 241s > ## Clone source to target repository without checking out any files 241s > repo_tgt <- clone(path_src, path_tgt, checkout = FALSE) 241s cloning into '/tmp/RtmpnEPf3v/git2r-991d31de1d'... 241s > 241s > ## List files in the repositores 241s > stopifnot(identical(list.files(path_src), filename)) 241s > stopifnot(identical(list.files(path_tgt), character(0))) 241s > 241s > ## Compare commits 241s > stopifnot(identical(length(commits(repo_tgt)), 1L)) 241s > commit_tgt <- last_commit(repo_tgt) 241s > stopifnot(identical(sha(last_commit(path_tgt)), sha(commit_tgt))) 241s > stopifnot(identical(sha(commit_src), sha(commit_tgt))) 241s > stopifnot(identical(commit_src$author, commit_tgt$author)) 241s > stopifnot(identical(commit_src$committer, commit_tgt$committer)) 241s > stopifnot(identical(commit_src$summary, commit_tgt$summary)) 241s > stopifnot(identical(commit_src$message, commit_tgt$message)) 241s > stopifnot(!identical(commit_src$repo, commit_tgt$repo)) 241s > 241s > ## Cleanup 241s > unlink(path_tgt, recursive = TRUE) 241s > unlink(path_src, recursive = TRUE) 241s > 241s BEGIN TEST commit.R 241s 241s R version 4.4.3 (2025-02-28) -- "Trophy Case" 241s Copyright (C) 2025 The R Foundation for Statistical Computing 241s Platform: s390x-ibm-linux-gnu 241s 241s R is free software and comes with ABSOLUTELY NO WARRANTY. 241s You are welcome to redistribute it under certain conditions. 241s Type 'license()' or 'licence()' for distribution details. 241s 241s R is a collaborative project with many contributors. 241s Type 'contributors()' for more information and 241s 'citation()' on how to cite R or R packages in publications. 241s 241s Type 'demo()' for some demos, 'help()' for on-line help, or 241s 'help.start()' for an HTML browser interface to help. 241s Type 'q()' to quit R. 241s 242s > ## git2r, R bindings to the libgit2 library. 242s > ## Copyright (C) 2013-2023 The git2r contributors 242s > ## 242s > ## This program is free software; you can redistribute it and/or modify 242s > ## it under the terms of the GNU General Public License, version 2, 242s > ## as published by the Free Software Foundation. 242s > ## 242s > ## git2r is distributed in the hope that it will be useful, 242s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 242s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 242s > ## GNU General Public License for more details. 242s > ## 242s > ## You should have received a copy of the GNU General Public License along 242s > ## with this program; if not, write to the Free Software Foundation, Inc., 242s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 242s > 242s > library(git2r) 242s > source("util/check.R") 242s > 242s > ## For debugging 242s > sessionInfo() 242s R version 4.4.3 (2025-02-28) 242s Platform: s390x-ibm-linux-gnu 242s Running under: Ubuntu Plucky Puffin (development branch) 242s 242s Matrix products: default 242s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 242s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 242s 242s locale: 242s [1] C 242s 242s time zone: Etc/UTC 242s tzcode source: system (glibc) 242s 242s attached base packages: 242s [1] stats graphics grDevices utils datasets methods base 242s 242s other attached packages: 242s [1] git2r_0.35.0 242s 242s loaded via a namespace (and not attached): 242s [1] compiler_4.4.3 242s > libgit2_version() 242s $major 242s [1] 1 242s 242s $minor 242s [1] 9 242s 242s $rev 242s [1] 0 242s 242s > libgit2_features() 242s $threads 242s [1] TRUE 242s 242s $https 242s [1] TRUE 242s 242s $ssh 242s [1] TRUE 242s 242s > 242s > 242s > ## Create a directory in tempdir 242s > path <- tempfile(pattern = "git2r-") 242s > dir.create(path) 242s > 242s > ## Initialize a repository 242s > repo <- init(path) 242s > config(repo, user.name = "Alice", user.email = "alice@example.org") 242s > 242s > ## Commit without adding changes should produce an error 242s > tools::assertError(commit(repo, "Test to commit")) 242s > 242s > ## Create a file 242s > writeLines("Hello world!", file.path(path, "test.txt")) 242s > 242s > ## Commit without adding changes should produce an error 242s > tools::assertError(commit(repo, "Test to commit")) 242s > 242s > ## Add 242s > add(repo, "test.txt") 242s > 242s > ## Commit with empty message should produce an error 242s > tools::assertError(commit(repo, "")) 242s > 242s > ## Commit 242s > commit_1 <- commit(repo, "Commit message", session = TRUE) 242s > summary(commit_1) 242s Commit: 4da20de6cf2fa14027aee963ce00877b1ddf6fa0 242s Author: Alice 242s When: 2025-03-15 18:07:49 GMT 242s 242s Commit message 242s 242s sessionInfo: 242s R version 4.4.3 (2025-02-28) 242s Platform: s390x-ibm-linux-gnu 242s Running under: Ubuntu Plucky Puffin (development branch) 242s 242s Matrix products: default 242s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 242s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 242s 242s locale: 242s [1] C 242s 242s time zone: Etc/UTC 242s tzcode source: system (glibc) 242s 242s attached base packages: 242s [1] stats graphics grDevices utils datasets methods base 242s 242s other attached packages: 242s [1] git2r_0.35.0 242s 242s loaded via a namespace (and not attached): 242s [1] compiler_4.4.3 tools_4.4.3 242s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 242s > 242s > ## Check commit 242s > stopifnot(identical(commit_1$author$name, "Alice")) 242s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 242s > stopifnot(identical(lookup(repo, sha(commit_1)), commit_1)) 242s > stopifnot(identical(length(commits(repo)), 1L)) 242s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 242s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 242s > stopifnot(identical(parents(commit_1), list())) 242s > stopifnot(identical(print(commit_1), commit_1)) 242s [4da20de] 2025-03-15: Commit message 242s > 242s > ## Check is_commit 242s > stopifnot(identical(is_commit(commit_1), TRUE)) 242s > stopifnot(identical(is_commit(5), FALSE)) 242s > 242s > ## Commit without adding changes should produce an error 242s > tools::assertError(commit(repo, "Test to commit")) 242s > 242s > ## Add another commit 242s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 242s > add(repo, "test.txt") 242s > commit_2 <- commit(repo, "Commit message 2") 242s > summary(commit_2) 242s Commit: 2c9a3a571053bba037715e2a1c0b01b6541107e7 242s Author: Alice 242s When: 2025-03-15 18:07:49 GMT 242s 242s Commit message 2 242s 1 file changed, 1 insertions, 0 deletions 242s test.txt | -0 +1 in 1 hunk 242s 242s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 242s > 242s > ## Check relationship 242s > stopifnot(identical(descendant_of(commit_2, commit_1), TRUE)) 242s > stopifnot(identical(descendant_of(commit_1, commit_2), FALSE)) 242s > stopifnot(identical(descendant_of(tag_2, tag_1), TRUE)) 242s > stopifnot(identical(descendant_of(tag_1, tag_2), FALSE)) 242s > stopifnot(identical(descendant_of(branches(repo)[[1]], commit_1), TRUE)) 242s > stopifnot(identical(descendant_of(commit_1, branches(repo)[[1]]), FALSE)) 242s > stopifnot(identical(length(parents(commit_2)), 1L)) 242s > stopifnot(identical(parents(commit_2)[[1]], commit_1)) 242s > 242s > ## Check contributions 242s > stopifnot(identical( 242s + colnames(contributions(repo, by = "author", breaks = "day")), 242s + c("when", "author", "n"))) 242s > stopifnot(identical(colnames(contributions(repo)), 242s + c("when", "n"))) 242s > stopifnot(identical(nrow(contributions(repo)), 1L)) 242s > stopifnot(identical(contributions(repo)$n, 2L)) 242s > stopifnot(identical(contributions(repo, by = "author", breaks = "day")$n, 2L)) 242s > 242s > ## Add another commit with 'all' argument 242s > writeLines(c("Hello world!", "HELLO WORLD!", "HeLlO wOrLd!"), 242s + file.path(path, "test.txt")) 242s > commit(repo, "Commit message 3", all = TRUE) 242s [48ac042] 2025-03-15: Commit message 3 242s > 242s > status_clean <- structure(list(staged = empty_named_list(), 242s + unstaged = empty_named_list(), 242s + untracked = empty_named_list()), 242s + class = "git_status") 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > ## Delete file and commit with 'all' argument 242s > file.remove(file.path(path, "test.txt")) 242s [1] TRUE 242s > commit(repo, "Commit message 4", all = TRUE) 242s [a35078b] 2025-03-15: Commit message 4 242s > 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > ## Add and commit multiple tracked files with 'all' argument 242s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 242s > add(repo, "test2.txt") 242s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 242s > add(repo, "test3.txt") 242s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 242s > add(repo, "test4.txt") 242s > commit(repo, "Commit message 5") 242s [cd69c8e] 2025-03-15: Commit message 5 242s > 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 242s > writeLines(sample(letters, 3), file.path(path, "test3.txt")) 242s > writeLines(sample(letters, 3), file.path(path, "test4.txt")) 242s > commit(repo, "Commit message 6", all = TRUE) 242s [f6a5912] 2025-03-15: Commit message 6 242s > 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > ## Add one tracked file and delete another with 'all' argument 242s > writeLines(sample(letters, 3), file.path(path, "test2.txt")) 242s > file.remove(file.path(path, "test4.txt")) 242s [1] TRUE 242s > commit(repo, "Commit message 7", all = TRUE) 242s [f54d151] 2025-03-15: Commit message 7 242s > 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > ## Delete multiple tracked files with 'all' argument 242s > file.remove(file.path(path, "test2.txt")) 242s [1] TRUE 242s > file.remove(file.path(path, "test3.txt")) 242s [1] TRUE 242s > commit(repo, "Commit message 8", all = TRUE) 242s [320d0f8] 2025-03-15: Commit message 8 242s > 242s > stopifnot(identical(status(repo), status_clean)) 242s > 242s > ## Check max number of commits in output 242s > stopifnot(identical(length(commits(repo)), 8L)) 242s > stopifnot(identical(length(commits(repo, n = -1)), 8L)) 242s > stopifnot(identical(length(commits(repo, n = 2)), 2L)) 242s > tools::assertError(commits(repo, n = 2.2)) 242s > tools::assertError(commits(repo, n = "2")) 242s > tools::assertError(commits(repo, n = 1:2)) 242s > 242s > ## Check to coerce repository to data.frame 242s > df <- as.data.frame(repo) 242s > stopifnot(identical(dim(df), c(8L, 6L))) 242s > stopifnot(identical(names(df), c("sha", "summary", "message", 242s + "author", "email", "when"))) 242s > 242s > ## Set working directory to path and check commits 242s > setwd(path) 242s > stopifnot(identical(sha(last_commit()), sha(commits(repo, n = 1)[[1]]))) 242s > stopifnot(identical(length(commits()), 8L)) 242s > stopifnot(identical(length(commits(n = -1)), 8L)) 242s > stopifnot(identical(length(commits(n = 2)), 2L)) 242s > tools::assertError(commits(n = 2.2)) 242s > tools::assertError(commits(n = "2")) 242s > 242s > ## Check plot method 242s > plot_file <- tempfile(fileext = ".pdf") 242s > pdf(plot_file) 242s > plot(repo) 242s > dev.off() 242s null device 242s 1 242s > stopifnot(file.exists(plot_file)) 242s > unlink(plot_file) 242s > 242s > ## Check punch card plot method 242s > punch_card_plot_file <- tempfile(fileext = ".pdf") 242s > pdf(punch_card_plot_file) 242s > punch_card(repo) 242s > dev.off() 242s null device 242s 1 242s > stopifnot(file.exists(punch_card_plot_file)) 242s > unlink(punch_card_plot_file) 242s > 242s > ## Check that 'git2r_arg_check_commit' raise error 242s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, NULL)) 242s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 242s + res[[1]]$message)) > 0) 242s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, 3)) 242s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 242s + res[[1]]$message)) > 0) 242s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, repo)) 242s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 242s + res[[1]]$message)) > 0) 242s > commit_1$sha <- NA_character_ 242s > res <- tools::assertError(.Call(git2r:::git2r_commit_tree, commit_1)) 242s > stopifnot(length(grep("'commit' must be an S3 class git_commit", 242s + res[[1]]$message)) > 0) 242s > 242s > ## Cleanup 242s > unlink(path, recursive = TRUE) 242s > 242s > if (identical(Sys.getenv("NOT_CRAN"), "true") || 242s + identical(Sys.getenv("R_COVR"), "true")) { 242s + path <- tempfile(pattern = "git2r-") 242s + dir.create(path) 242s + setwd(path) 242s + system("git clone --depth 2 https://github.com/ropensci/git2r.git") 242s + 242s + ## Check the number of commits in the shallow clone. 242s + stopifnot(identical(length(commits(repository("git2r"))), 2L)) 242s + stopifnot(identical(length(commits(repository("git2r"), n = 1)), 1L)) 242s + 242s + ## Cleanup 242s + unlink(path, recursive = TRUE) 242s + } 242s > 242s sh: 0: getcwd() failed: No such file or directory 242s BEGIN TEST commits_path.R 242s 242s R version 4.4.3 (2025-02-28) -- "Trophy Case" 242s Copyright (C) 2025 The R Foundation for Statistical Computing 242s Platform: s390x-ibm-linux-gnu 242s 242s R is free software and comes with ABSOLUTELY NO WARRANTY. 242s You are welcome to redistribute it under certain conditions. 242s Type 'license()' or 'licence()' for distribution details. 242s 242s R is a collaborative project with many contributors. 242s Type 'contributors()' for more information and 242s 'citation()' on how to cite R or R packages in publications. 242s 242s Type 'demo()' for some demos, 'help()' for on-line help, or 242s 'help.start()' for an HTML browser interface to help. 242s Type 'q()' to quit R. 242s 242s > ## git2r, R bindings to the libgit2 library. 242s > ## Copyright (C) 2013-2023 The git2r contributors 242s > ## 242s > ## This program is free software; you can redistribute it and/or modify 242s > ## it under the terms of the GNU General Public License, version 2, 242s > ## as published by the Free Software Foundation. 242s > ## 242s > ## git2r is distributed in the hope that it will be useful, 242s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 242s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 242s > ## GNU General Public License for more details. 242s > ## 242s > ## You should have received a copy of the GNU General Public License along 242s > ## with this program; if not, write to the Free Software Foundation, Inc., 242s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 242s > 242s > library(git2r) 242s > 242s > ## For debugging 242s > sessionInfo() 242s R version 4.4.3 (2025-02-28) 242s Platform: s390x-ibm-linux-gnu 242s Running under: Ubuntu Plucky Puffin (development branch) 242s 242s Matrix products: default 242s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 242s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 242s 242s locale: 242s [1] C 242s 242s time zone: Etc/UTC 242s tzcode source: system (glibc) 242s 242s attached base packages: 242s [1] stats graphics grDevices utils datasets methods base 242s 242s other attached packages: 242s [1] git2r_0.35.0 242s 242s loaded via a namespace (and not attached): 242s [1] compiler_4.4.3 242s > libgit2_version() 242s $major 242s [1] 1 242s 242s $minor 242s [1] 9 242s 242s $rev 242s [1] 0 242s 242s > libgit2_features() 242s $threads 242s [1] TRUE 242s 242s $https 242s [1] TRUE 242s 242s $ssh 242s [1] TRUE 242s 242s > 242s > 242s > ## Create a directory in tempdir 242s > path <- tempfile(pattern = "git2r-") 242s > dir.create(path) 242s > 242s > ## Initialize a repository 242s > repo <- init(path, branch = "main") 242s > config(repo, user.name = "Alice", user.email = "alice@example.org") 242s > 242s > ## Create two files and alternate commits 242s > writeLines("1", file.path(path, "odd.txt")) 242s > add(repo, "odd.txt") 242s > c1 <- commit(repo, "commit 1") 242s > 242s > writeLines("2", file.path(path, "even.txt")) 242s > add(repo, "even.txt") 242s > c2 <- commit(repo, "commit 2") 242s > 242s > writeLines("3", file.path(path, "odd.txt")) 242s > add(repo, "odd.txt") 242s > c3 <- commit(repo, "commit 3") 242s > 242s > writeLines("4", file.path(path, "even.txt")) 242s > add(repo, "even.txt") 242s > c4 <- commit(repo, "commit 4") 242s > 242s > writeLines("5", file.path(path, "odd.txt")) 242s > add(repo, "odd.txt") 242s > c5 <- commit(repo, "commit 5") 242s > 242s > writeLines("6", file.path(path, "even.txt")) 242s > add(repo, "even.txt") 242s > c6 <- commit(repo, "commit 6") 242s > 242s > commits_all <- commits(repo) 242s > stopifnot(length(commits_all) == 6) 242s > 242s > ## Test path 242s > commits_odd <- commits(repo, path = "odd.txt") 242s > stopifnot(length(commits_odd) == 3) 242s > stopifnot(commits_odd[[1]]$sha == c5$sha) 242s > stopifnot(commits_odd[[2]]$sha == c3$sha) 242s > stopifnot(commits_odd[[3]]$sha == c1$sha) 242s > 242s > commits_even <- commits(repo, path = "even.txt") 242s > stopifnot(length(commits_even) == 3) 242s > stopifnot(commits_even[[1]]$sha == c6$sha) 242s > stopifnot(commits_even[[2]]$sha == c4$sha) 242s > stopifnot(commits_even[[3]]$sha == c2$sha) 242s > 242s > ## Test reverse 242s > commits_odd_rev <- commits(repo, reverse = TRUE, path = "odd.txt") 242s > stopifnot(length(commits_odd_rev) == 3) 242s > stopifnot(commits_odd_rev[[1]]$sha == c1$sha) 242s > stopifnot(commits_odd_rev[[2]]$sha == c3$sha) 242s > stopifnot(commits_odd_rev[[3]]$sha == c5$sha) 242s > 242s > commits_even_rev <- commits(repo, reverse = TRUE, path = "even.txt") 242s > stopifnot(length(commits_even_rev) == 3) 242s > stopifnot(commits_even_rev[[1]]$sha == c2$sha) 242s > stopifnot(commits_even_rev[[2]]$sha == c4$sha) 242s > stopifnot(commits_even_rev[[3]]$sha == c6$sha) 242s > 242s > ## Test n 242s > commits_odd_n <- commits(repo, n = 2, path = "odd.txt") 242s > stopifnot(length(commits_odd_n) == 2) 242s > stopifnot(commits_odd_n[[1]]$sha == c5$sha) 242s > stopifnot(commits_odd_n[[2]]$sha == c3$sha) 242s > 242s > commits_even_n <- commits(repo, n = 2, path = "even.txt") 242s > stopifnot(length(commits_even_n) == 2) 242s > stopifnot(commits_even_n[[1]]$sha == c6$sha) 242s > stopifnot(commits_even_n[[2]]$sha == c4$sha) 242s > 242s > commits_odd_0 <- commits(repo, n = 0, path = "odd.txt") 242s > stopifnot(length(commits_odd_0) == 0) 242s > stopifnot(identical(commits_odd_0, list())) 242s > 242s > commits_even_0 <- commits(repo, n = 0, path = "even.txt") 242s > stopifnot(length(commits_even_0) == 0) 242s > stopifnot(identical(commits_even_0, list())) 242s > 242s > ## Test ref 242s > checkout(repo, branch = "test-ref", create = TRUE) 242s > 242s > writeLines("7", file.path(path, "odd.txt")) 242s > add(repo, "odd.txt") 242s > c7 <- commit(repo, "commit 7") 242s > 242s > writeLines("8", file.path(path, "even.txt")) 242s > add(repo, "even.txt") 242s > c8 <- commit(repo, "commit 8") 242s > 242s > commits_odd_ref <- commits(repo, ref = "main", path = "odd.txt") 242s > stopifnot(length(commits_odd_ref) == 3) 242s > stopifnot(commits_odd_ref[[1]]$sha == c5$sha) 242s > stopifnot(commits_odd_ref[[2]]$sha == c3$sha) 242s > stopifnot(commits_odd_ref[[3]]$sha == c1$sha) 242s > 242s > commits_even_ref <- commits(repo, ref = "main", path = "even.txt") 242s > stopifnot(length(commits_even_ref) == 3) 242s > stopifnot(commits_even_ref[[1]]$sha == c6$sha) 242s > stopifnot(commits_even_ref[[2]]$sha == c4$sha) 242s > stopifnot(commits_even_ref[[3]]$sha == c2$sha) 242s > 242s > checkout(repo, branch = "main") 242s > 242s > ## Test renaming a file (path does not support --follow) 242s > writeLines("a file to be renamed", file.path(path, "original.txt")) 242s > add(repo, "original.txt") 242s > c_original <- commit(repo, "commit original") 242s > 242s > commits_original <- commits(repo, path = "original.txt") 242s > stopifnot(length(commits_original) == 1) 242s > stopifnot(commits_original[[1]]$sha == c_original$sha) 242s > 242s > file.rename(file.path(path, "original.txt"), file.path(path, "new.txt")) 242s [1] TRUE 242s > add(repo, c("original.txt", "new.txt")) 242s > c_new <- commit(repo, "commit new") 242s > 242s > commits_new <- commits(repo, path = "new.txt") 242s > stopifnot(length(commits_new) == 1) 242s > stopifnot(commits_new[[1]]$sha == c_new$sha) 242s > 242s > ## Test merge commits 242s > writeLines(letters[1:5], file.path(path, "merge.txt")) 242s > add(repo, "merge.txt") 242s > c_merge_1 <- commit(repo, "commit merge 1") 242s > 242s > checkout(repo, branch = "test-merge", create = TRUE) 242s > cat("z", file = file.path(path, "merge.txt"), append = TRUE) 242s > add(repo, "merge.txt") 242s > c_merge_2 <- commit(repo, "commit merge 2") 242s > 242s > checkout(repo, branch = "main") 242s > writeLines(c("A", letters[2:5]), file.path(path, "merge.txt")) 242s > add(repo, "merge.txt") 242s > c_merge_3 <- commit(repo, "commit merge 3") 242s > 242s > c_merge_4 <- merge(repo, "test-merge") 242s > stopifnot(class(c_merge_4) == "git_merge_result") 242s > 242s > commits_merge <- commits(repo, path = "merge.txt") 242s > stopifnot(length(commits_merge) == 4) 242s > stopifnot(commits_merge[[1]]$sha == c_merge_4$sha) 242s > stopifnot(commits_merge[[2]]$sha == c_merge_3$sha) 242s > stopifnot(commits_merge[[3]]$sha == c_merge_2$sha) 242s > stopifnot(commits_merge[[4]]$sha == c_merge_1$sha) 242s > 242s > ## Test absolute path 242s > writeLines("absolute", file.path(path, "abs.txt")) 242s > add(repo, "abs.txt") 242s > c_abs <- commit(repo, "commit absolute") 242s > 242s > commits_abs <- commits(repo, path = file.path(path, "abs.txt")) 242s > stopifnot(length(commits_abs) == 1) 242s > stopifnot(commits_abs[[1]]$sha == c_abs$sha) 242s > 242s > ## Test topological and time 242s > ## Strategy: 242s > ## - Commit a new file test-time.txt 242s > ## - Commit a change on branch test-time-1 (a) 242s > ## - Commit a change on branch test-time-2 (c) 242s > ## - Commit a change on branch test-time-1 (b) 242s > ## - Commit a change on branch test-time-2 (d) 242s > ## - Merge branch test-time-2 into main (fast-forward) 242s > ## - Merge branch test-time-1 into main (merge commit) 242s > ## 242s > ## $ git log --all --decorate --oneline --graph -n 6 242s > ## * 79e6880 (HEAD -> main) merge test-time-1 242s > ## |\ 242s > ## | * e2f18f1 (test-time-1) commit b 242s > ## | * 5f34820 commit a 242s > ## * | b954ec9 (test-time-2) commit d 242s > ## * | 7ae2fd5 commit c 242s > ## |/ 242s > ## * 923f3ea commit base 242s > Sys.sleep(1) 243s > writeLines(as.character(1:100), file.path(path, "test-time.txt")) 243s > add(repo, "test-time.txt") 243s > c_base <- commit(repo, "commit base") 243s > Sys.sleep(1) 244s > branch_create(commit = c_base, name = "test-time-1") 244s > branch_create(commit = c_base, name = "test-time-2") 244s > 244s > checkout(repo, branch = "test-time-1") 244s > writeLines(c("edit", 2:100), file.path(path, "test-time.txt")) 244s > add(repo, "test-time.txt") 244s > c_a <- commit(repo, "commit a") 244s > Sys.sleep(1) 245s > 245s > checkout(repo, branch = "test-time-2") 245s > writeLines(c(1:25, "edit", 27:100), file.path(path, "test-time.txt")) 245s > add(repo, "test-time.txt") 245s > c_c <- commit(repo, "commit c") 245s > Sys.sleep(1) 246s > 246s > checkout(repo, branch = "test-time-1") 246s > writeLines(c(1:50, "edit", 52:100), file.path(path, "test-time.txt")) 246s > add(repo, "test-time.txt") 246s > c_b <- commit(repo, "commit b") 246s > Sys.sleep(1) 247s > 247s > checkout(repo, branch = "test-time-2") 247s > writeLines(c(1:75, "edit", 77:100), file.path(path, "test-time.txt")) 247s > add(repo, "test-time.txt") 247s > c_d <- commit(repo, "commit d") 247s > Sys.sleep(1) 248s > 248s > checkout(repo, branch = "main") 248s > merge(repo, "test-time-2") # Fast-forward 248s Merge: Fast-forward 248s > merge(repo, "test-time-1") # Merge commit 248s Merge 248s > c_merge_time <- commits(repo, n = 1)[[1]] 248s > 248s > ## topological - commits in test-time-2 come first because it was 248s > ## merged first 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 248s + list(c_merge_time, c_b, c_a, c_d, c_c, c_base) 248s + )) 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = FALSE, path = "test-time.txt"), 248s + commits(repo, topological = TRUE, time = FALSE)[1:6] 248s + )) 248s > 248s > ## time - commits ordered by time they were created, not merged into 248s > ## main 248s > stopifnot(identical( 248s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 248s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 248s + )) 248s > stopifnot(identical( 248s + commits(repo, topological = FALSE, time = TRUE, path = "test-time.txt"), 248s + commits(repo, topological = FALSE, time = TRUE)[1:6] 248s + )) 248s > 248s > ## topological and time - dominated by time 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 248s + list(c_merge_time, c_d, c_b, c_c, c_a, c_base) 248s + )) 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = TRUE, path = "test-time.txt"), 248s + commits(repo, topological = TRUE, time = TRUE)[1:6] 248s + )) 248s > 248s > ## reverse with topological and/or time 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = FALSE, reverse = TRUE, 248s + path = "test-time.txt"), 248s + rev(list(c_merge_time, c_b, c_a, c_d, c_c, c_base)) 248s + )) 248s > stopifnot(identical( 248s + commits(repo, topological = FALSE, time = TRUE, reverse = TRUE, 248s + path = "test-time.txt"), 248s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 248s + )) 248s > stopifnot(identical( 248s + commits(repo, topological = TRUE, time = TRUE, reverse = TRUE, 248s + path = "test-time.txt"), 248s + rev(list(c_merge_time, c_d, c_b, c_c, c_a, c_base)) 248s + )) 248s > 248s > ## Cleanup 248s > unlink(path, recursive = TRUE) 248s > 248s BEGIN TEST config.R 248s 248s R version 4.4.3 (2025-02-28) -- "Trophy Case" 248s Copyright (C) 2025 The R Foundation for Statistical Computing 248s Platform: s390x-ibm-linux-gnu 248s 248s R is free software and comes with ABSOLUTELY NO WARRANTY. 248s You are welcome to redistribute it under certain conditions. 248s Type 'license()' or 'licence()' for distribution details. 248s 248s R is a collaborative project with many contributors. 248s Type 'contributors()' for more information and 248s 'citation()' on how to cite R or R packages in publications. 248s 248s Type 'demo()' for some demos, 'help()' for on-line help, or 248s 'help.start()' for an HTML browser interface to help. 248s Type 'q()' to quit R. 248s 248s > ## git2r, R bindings to the libgit2 library. 248s > ## Copyright (C) 2013-2023 The git2r contributors 248s > ## 248s > ## This program is free software; you can redistribute it and/or modify 248s > ## it under the terms of the GNU General Public License, version 2, 248s > ## as published by the Free Software Foundation. 248s > ## 248s > ## git2r is distributed in the hope that it will be useful, 248s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 248s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 248s > ## GNU General Public License for more details. 248s > ## 248s > ## You should have received a copy of the GNU General Public License along 248s > ## with this program; if not, write to the Free Software Foundation, Inc., 248s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 248s > 248s > library("git2r") 248s > 248s > ## For debugging 248s > sessionInfo() 248s R version 4.4.3 (2025-02-28) 248s Platform: s390x-ibm-linux-gnu 248s Running under: Ubuntu Plucky Puffin (development branch) 248s 248s Matrix products: default 248s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 248s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 248s 248s locale: 248s [1] C 248s 248s time zone: Etc/UTC 248s tzcode source: system (glibc) 248s 248s attached base packages: 248s [1] stats graphics grDevices utils datasets methods base 248s 248s other attached packages: 248s [1] git2r_0.35.0 248s 248s loaded via a namespace (and not attached): 248s [1] compiler_4.4.3 248s > libgit2_version() 248s $major 248s [1] 1 248s 248s $minor 248s [1] 9 248s 248s $rev 248s [1] 0 248s 248s > libgit2_features() 248s $threads 248s [1] TRUE 248s 248s $https 248s [1] TRUE 248s 248s $ssh 248s [1] TRUE 248s 248s > 248s > 248s > ## Create a directory in tempdir 248s > path <- tempfile(pattern = "git2r-") 248s > dir.create(path) 248s > 248s > ## Initialize a repository 248s > repo <- init(path) 248s > 248s > ## Config repository 248s > cfg <- config(repo, user.name = "Alice", user.email = "alice@example.org") 248s > 248s > ## Check configuration 248s > stopifnot(identical(print(cfg), cfg)) 248s local: 248s core.bare=false 248s core.filemode=true 248s core.logallrefupdates=true 248s core.repositoryformatversion=0 248s user.email=alice@example.org 248s user.name=Alice 248s > stopifnot("local" %in% names(cfg)) 248s > stopifnot("user.name" %in% names(cfg$local)) 248s > stopifnot(identical(cfg$local$user.name, "Alice")) 248s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 248s > 248s > ## Check that config fails for non-character entry. 248s > tools::assertError(config(repo, test = 5)) 248s > 248s > ## Check config method with missing repo argument 248s > wd <- setwd(path) 248s > cfg <- config(user.name = "Alice", user.email = "alice@example.org") 248s > stopifnot("local" %in% names(cfg)) 248s > stopifnot("user.name" %in% names(cfg$local)) 248s > stopifnot(identical(cfg$local$user.name, "Alice")) 248s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 248s > stopifnot(identical(git_config_files(repo = repo)$local, 248s + git_config_files(repo = NULL)$local)) 248s > stopifnot(identical(git_config_files(repo = repo)$local, 248s + git_config_files(repo = repo$path)$local)) 248s > if (!is.null(wd)) 248s + setwd(wd) 248s > 248s > ## Delete entries 248s > cfg <- config(repo, user.name = NULL, user.email = NULL) 248s > 248s > ## Check configuration 248s > stopifnot(is.null(cfg$local$user.name)) 248s > stopifnot(is.null(cfg$local$user.email)) 248s > 248s > ## Supply values as objects 248s > user_name <- "Alice" 248s > user_email <- "alice@example.org" 248s > cfg <- config(repo, user.name = user_name, user.email = "alice@example.org") 248s > stopifnot(identical(cfg$local$user.name, user_name)) 248s > stopifnot(identical(cfg$local$user.email, "alice@example.org")) 248s > cfg <- config(repo, user.name = "Alice", user.email = user_email) 248s > stopifnot(identical(cfg$local$user.name, "Alice")) 248s > stopifnot(identical(cfg$local$user.email, user_email)) 248s > 248s > ## Check git config files 248s > cfg <- git_config_files(repo) 248s > stopifnot(identical(nrow(cfg), 4L)) 248s > stopifnot(identical(names(cfg), c("file", "path"))) 248s > stopifnot(identical(cfg$file, c("system", "xdg", "global", "local"))) 248s > stopifnot(!is.na(cfg$path[4])) 248s > 248s > ## Check that the local config file is NA for an invalid repo 248s > ## argument. 248s > stopifnot(is.na(git_config_files(5)$local)) 248s > 248s > ## Check location of .gitconfig on Windows 248s > if (identical(Sys.getenv("APPVEYOR"), "True")) { 248s + 248s + ## AppVeyor diagnostics 248s + str(Sys.getenv("USERPROFILE")) 248s + str(Sys.getenv("HOMEDRIVE")) 248s + str(normalizePath("~")) 248s + str(git_config_files()) 248s + 248s + ## Temporarily move AppVeyor .gitconfig 248s + gitconfig_appveyor <- "C:/Users/appveyor/.gitconfig" 248s + gitconfig_tmp <- file.path(tempdir(), ".gitconfig") 248s + file.rename(gitconfig_appveyor, gitconfig_tmp) 248s + 248s + ## Test config() on Windows 248s + gitconfig_expected <- file.path(Sys.getenv("USERPROFILE"), ".gitconfig") 248s + ## .gitconfig should not be created if no configuration options specified 248s + config(global = TRUE) 248s + stopifnot(!file.exists(gitconfig_expected)) 248s + ## .gitconfig should be created in the user's home directory 248s + config(global = TRUE, user.name = "name", user.email = "email") 248s + stopifnot(file.exists(gitconfig_expected)) 248s + unlink(gitconfig_expected) 248s + ## .gitconfig should be created if user specifies option other than user.name 248s + ## and user.email 248s + config(global = TRUE, core.editor = "nano") 248s + stopifnot(file.exists(gitconfig_expected)) 248s + unlink(gitconfig_expected) 248s + ## .gitconfig should not create a new .gitconfig if the user already has one 248s + ## in Documents/ 248s + gitconfig_documents <- "~/.gitconfig" 248s + file.create(gitconfig_documents) 248s + config(global = TRUE, core.editor = "nano") 248s + stopifnot(!file.exists(gitconfig_expected)) 248s + unlink(gitconfig_documents) 248s + 248s + ## Return AppVeyor .gitconfig 248s + file.rename(gitconfig_tmp, gitconfig_appveyor) 248s + } 248s > 248s > ## Cleanup 248s > unlink(path, recursive = TRUE) 248s > 248s BEGIN TEST diff.R 248s 248s R version 4.4.3 (2025-02-28) -- "Trophy Case" 248s Copyright (C) 2025 The R Foundation for Statistical Computing 248s Platform: s390x-ibm-linux-gnu 248s 248s R is free software and comes with ABSOLUTELY NO WARRANTY. 248s You are welcome to redistribute it under certain conditions. 248s Type 'license()' or 'licence()' for distribution details. 248s 248s R is a collaborative project with many contributors. 248s Type 'contributors()' for more information and 248s 'citation()' on how to cite R or R packages in publications. 248s 248s Type 'demo()' for some demos, 'help()' for on-line help, or 248s 'help.start()' for an HTML browser interface to help. 248s Type 'q()' to quit R. 248s 248s > ## git2r, R bindings to the libgit2 library. 248s > ## Copyright (C) 2013-2023 The git2r contributors 248s > ## 248s > ## This program is free software; you can redistribute it and/or modify 248s > ## it under the terms of the GNU General Public License, version 2, 248s > ## as published by the Free Software Foundation. 248s > ## 248s > ## git2r is distributed in the hope that it will be useful, 248s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 248s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 248s > ## GNU General Public License for more details. 248s > ## 248s > ## You should have received a copy of the GNU General Public License along 248s > ## with this program; if not, write to the Free Software Foundation, Inc., 248s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 248s > 248s > library("git2r") 248s > 248s > ## For debugging 248s > sessionInfo() 248s R version 4.4.3 (2025-02-28) 248s Platform: s390x-ibm-linux-gnu 248s Running under: Ubuntu Plucky Puffin (development branch) 248s 248s Matrix products: default 248s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 248s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 248s 248s locale: 248s [1] C 248s 248s time zone: Etc/UTC 248s tzcode source: system (glibc) 248s 248s attached base packages: 248s [1] stats graphics grDevices utils datasets methods base 248s 248s other attached packages: 248s [1] git2r_0.35.0 248s 248s loaded via a namespace (and not attached): 248s [1] compiler_4.4.3 248s > libgit2_version() 248s $major 248s [1] 1 248s 248s $minor 248s [1] 9 248s 248s $rev 248s [1] 0 248s 248s > libgit2_features() 248s $threads 248s [1] TRUE 248s 248s $https 248s [1] TRUE 248s 248s $ssh 248s [1] TRUE 248s 248s > 248s > 248s > ## Create a directory in tempdir 248s > path <- tempfile(pattern = "git2r-") 248s > dir.create(path) 248s > 248s > ## Initialize a repository 248s > repo <- init(path) 248s > config(repo, user.name = "Alice", user.email = "alice@example.org") 248s > 248s > ## Create a file, add, commit 248s > writeLines("Hello world!", file.path(path, "test.txt")) 248s > add(repo, "test.txt") 248s > commit(repo, "Commit message") 248s [41a586a] 2025-03-15: Commit message 248s > 248s > ## Change the file, diff between index and workdir 248s > writeLines("Hello again!\nHere is a second line\nAnd a third", 248s + file.path(path, "test.txt")) 248s > diff_1 <- diff(repo) 248s > diff(repo, as_char = TRUE) 248s [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" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_1$old, "index")) 248s > stopifnot(identical(diff_1$new, "workdir")) 248s > stopifnot(identical(length(diff_1$files), 1L)) 248s > stopifnot(identical(diff_1$files[[1]]$old_file, "test.txt")) 248s > stopifnot(identical(diff_1$files[[1]]$new_file, "test.txt")) 248s > stopifnot(identical(length(diff_1$files[[1]]$hunks), 1L)) 248s > stopifnot(identical(length(diff_1$files[[1]]$hunks[[1]]$lines), 4L)) 248s > ## TODO: check actual diff 248s > 248s > ## Diff between index and HEAD is empty 248s > diff_2 <- diff(repo, index = TRUE) 248s > diff(repo, as_char = TRUE) 248s [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" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_2$old, "HEAD")) 248s > stopifnot(identical(diff_2$new, "index")) 248s > stopifnot(identical(diff_2$files, list())) 248s > 248s > ## Diff between tree and working dir, same as diff_1 248s > diff_3 <- diff(tree(commits(repo)[[1]])) 248s > diff(repo, as_char = TRUE) 248s [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" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_3$old, tree(commits(repo)[[1]]))) 248s > stopifnot(identical(diff_3$new, "workdir")) 248s > stopifnot(identical(diff_3$files, diff_1$files)) 248s > stopifnot(identical(print(diff_3), diff_3)) 248s Old: tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 248s 248s mode type sha name 248s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 248s New: workdir 248s > 248s > ## Add changes, diff between index and HEAD is the same as diff_1 248s > add(repo, "test.txt") 248s > diff_4 <- diff(repo, index = TRUE) 248s > diff(repo, as_char = TRUE) 248s [1] "" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_4$old, "HEAD")) 248s > stopifnot(identical(diff_4$new, "index")) 248s > stopifnot(identical(diff_4$files, diff_1$files)) 248s > 248s > ## Diff between tree and index 248s > diff_5 <- diff(tree(commits(repo)[[1]]), index = TRUE) 248s > diff(repo, as_char = TRUE) 248s [1] "" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_5$old, tree(commits(repo)[[1]]))) 248s > stopifnot(identical(diff_5$new, "index")) 248s > stopifnot(identical(diff_5$files, diff_1$files)) 248s > 248s > ## Diff between two trees 248s > commit(repo, "Second commit") 248s [ae73e97] 2025-03-15: Second commit 248s > tree_1 <- tree(commits(repo)[[2]]) 248s > tree_2 <- tree(commits(repo)[[1]]) 248s > diff_6 <- diff(tree_1, tree_2) 248s > diff(repo, as_char = TRUE) 248s [1] "" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(identical(diff_6$old, tree_1)) 248s > stopifnot(identical(diff_6$new, tree_2)) 248s > stopifnot(identical(diff_6$files, diff_1$files)) 248s > 248s > ## Length of a diff 248s > stopifnot(identical(length(diff_1), 1L)) 248s > stopifnot(identical(length(diff_2), 0L)) 248s > stopifnot(identical(length(diff_3), 1L)) 248s > stopifnot(identical(length(diff_4), 1L)) 248s > stopifnot(identical(length(diff_5), 1L)) 248s > stopifnot(identical(length(diff_6), 1L)) 248s > 248s > ## Binary files 248s > set.seed(42) 248s > writeBin(as.raw((sample(0:255, 1000, replace = TRUE))), 248s + con = file.path(path, "test.bin")) 248s > add(repo, "test.bin") 248s > diff_7 <- diff(repo, index = TRUE) 248s > diff(repo, as_char = TRUE) 248s [1] "" 248s > diff(repo, as_char = TRUE, filename = file.path(path, "test.diff")) 248s NULL 248s > 248s > stopifnot(any(grepl("binary file", capture.output(summary(diff_7))))) 248s > 248s > ## TODO: errors 248s > ## Check non-logical index argument 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, NULL, NULL, NULL, "FALSE", 248s + NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep(paste0("Error in 'git2r_diff': 'index' must be logical ", 248s + "vector of length one with non NA value\n"), 248s + res[[1]]$message)) > 0) 248s > 248s > ## Check various combinations of diff arguments 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, NULL, NULL, 248s + tree(commits(repo)[[1]]), 248s + FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, NULL, NULL, 248s + tree(commits(repo)[[1]]), 248s + TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 248s + NULL, FALSE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 248s + NULL, TRUE, NULL, 3L, 0L, "a", "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 248s + tree(commits(repo)[[2]]), FALSE, NULL, 3L, 0L, "a", 248s + "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > res <- tools::assertError( 248s + .Call(git2r:::git2r_diff, repo, tree(commits(repo)[[1]]), 248s + tree(commits(repo)[[2]]), TRUE, NULL, 3L, 0L, "a", 248s + "b", NULL, NULL, NULL)) 248s > stopifnot(length(grep("Error in 'git2r_diff': Invalid diff parameters", 248s + res[[1]]$message)) > 0) 248s > 248s > ## TODO: printing 248s > 248s > ## Cleanup 248s > unlink(path, recursive = TRUE) 248s > 248s BEGIN TEST fast_forward_merge.R 248s 248s R version 4.4.3 (2025-02-28) -- "Trophy Case" 248s Copyright (C) 2025 The R Foundation for Statistical Computing 248s Platform: s390x-ibm-linux-gnu 248s 248s R is free software and comes with ABSOLUTELY NO WARRANTY. 248s You are welcome to redistribute it under certain conditions. 248s Type 'license()' or 'licence()' for distribution details. 248s 248s R is a collaborative project with many contributors. 248s Type 'contributors()' for more information and 248s 'citation()' on how to cite R or R packages in publications. 248s 248s Type 'demo()' for some demos, 'help()' for on-line help, or 248s 'help.start()' for an HTML browser interface to help. 248s Type 'q()' to quit R. 248s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library(git2r) 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > ## Create directory for repository in tempdir 249s > path <- tempfile(pattern = "git2r-") 249s > dir.create(path) 249s > 249s > ## Create repository 249s > repo <- init(path, branch = "main") 249s > config(repo, user.name = "Alice", user.email = "alice@example.org") 249s > 249s > ## Add changes to repo 249s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 249s + con = file.path(path, "test-1.txt")) 249s > add(repo, "test-1.txt") 249s > commit_1 <- commit(repo, "First commit message") 249s > 249s > ## Create branch and checkout 249s > checkout(branch_create(commit_1, name = "test")) 249s > 249s > ## Add changes to test branch 249s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 249s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 249s + con = file.path(path, "test-1.txt")) 249s > add(repo, "test-1.txt") 249s > commit_2 <- commit(repo, "Second commit message") 249s > 249s > # Checkout main and merge 249s > b <- branches(repo) 249s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 249s > m <- merge(b[sapply(b, "[", "name") == "test"][[1]]) 249s > 249s > # Check merge 249s > stopifnot(inherits(m, "git_merge_result")) 249s > stopifnot(identical(m$up_to_date, FALSE)) 249s > stopifnot(identical(m$fast_forward, TRUE)) 249s > stopifnot(identical(m$conflicts, FALSE)) 249s > stopifnot(identical(sha(m), NA_character_)) 249s > stopifnot(identical(length(commits(repo)), 2L)) 249s > 249s > # Check reflog 249s > r <- reflog(repo) 249s > stopifnot(identical(r[[1]]$message, "merge test: Fast-forward")) 249s > 249s > ## Cleanup 249s > unlink(path, recursive = TRUE) 249s > 249s BEGIN TEST fetch.R 249s 249s R version 4.4.3 (2025-02-28) -- "Trophy Case" 249s Copyright (C) 2025 The R Foundation for Statistical Computing 249s Platform: s390x-ibm-linux-gnu 249s 249s R is free software and comes with ABSOLUTELY NO WARRANTY. 249s You are welcome to redistribute it under certain conditions. 249s Type 'license()' or 'licence()' for distribution details. 249s 249s R is a collaborative project with many contributors. 249s Type 'contributors()' for more information and 249s 'citation()' on how to cite R or R packages in publications. 249s 249s Type 'demo()' for some demos, 'help()' for on-line help, or 249s 'help.start()' for an HTML browser interface to help. 249s Type 'q()' to quit R. 249s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library(git2r) 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > ## Create 2 directories in tempdir 249s > path_bare <- tempfile(pattern = "git2r-") 249s > path_repo_1 <- tempfile(pattern = "git2r-") 249s > path_repo_2 <- tempfile(pattern = "git2r-") 249s > 249s > dir.create(path_bare) 249s > dir.create(path_repo_1) 249s > dir.create(path_repo_2) 249s > 249s > ## Create repositories 249s > bare_repo <- init(path_bare, bare = TRUE) 249s > repo_1 <- clone(path_bare, path_repo_1) 249s cloning into '/tmp/RtmphlvA4E/git2r-9d911857c48'... 249s > repo_2 <- clone(path_bare, path_repo_2) 249s cloning into '/tmp/RtmphlvA4E/git2r-9d9461d1672'... 249s > 249s > ## Config repositories 249s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 249s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 249s > 249s > ## Add changes to repo 1 249s > writeLines("Hello world", con = file.path(path_repo_1, "test.txt")) 249s > add(repo_1, "test.txt") 249s > commit_1 <- commit(repo_1, "Commit message") 249s > branch_name <- branches(repo_1)[[1]]$name 249s > 249s > ## Push changes from repo 1 to origin 249s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 249s > 249s > ## Check result in bare repository 249s > stopifnot(identical(length(commits(bare_repo)), 1L)) 249s > bare_commit_1 <- commits(bare_repo)[[1]] 249s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 249s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 249s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 249s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 249s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 249s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 249s > 249s > ## Fetch 249s > fetch(repo_2, "origin") 249s [new] 7c4d4b57c14a6bfcc89f refs/remotes/origin/master 249s > fh <- fetch_heads(repo_2)[[1]] 249s > stopifnot(identical(sha(fh), fh$sha)) 249s > 249s > ## Test show method of non-empty repository where head is null 249s > show(repo_2) 249s Local: /tmp/RtmphlvA4E/git2r-9d9461d1672 249s Head: nothing commited (yet) 249s > 249s > ## Check that 'git2r_arg_check_credentials' raise error 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", 249s + 3, "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", repo_1, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- cred_env(c("username", "username"), "password") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- cred_env("username", c("password", "passowrd")) 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- cred_user_pass(c("username", "username"), "password") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- cred_user_pass("username", c("password", "passowrd")) 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- cred_token(c("GITHUB_PAT", "GITHUB_PAT")) 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- structure(list(publickey = c("id_rsa.pub", "id_rsa.pub"), 249s + privatekey = "id_rsa", 249s + passphrase = character(0)), 249s + class = "cred_ssh_key") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- structure(list(publickey = "id_rsa.pub", 249s + privatekey = c("id_rsa", "id_rsa"), 249s + passphrase = character(0)), 249s + class = "cred_ssh_key") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- structure(list(publickey = "id_rsa.pub", 249s + privatekey = "id_rsa", 249s + passphrase = NA_character_), 249s + class = "cred_ssh_key") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > credentials <- structure(list(publickey = "id_rsa.pub", 249s + privatekey = "id_rsa", 249s + passphrase = c("passphrase", "passphrase")), 249s + class = "cred_ssh_key") 249s > res <- tools::assertError( 249s + .Call(git2r:::git2r_remote_fetch, repo_1, "origin", credentials, 249s + "fetch", FALSE, NULL)) 249s > stopifnot(length(grep("'credentials' must be an S3 class with credentials", 249s + res[[1]]$message)) > 0) 249s > 249s > ## Cleanup 249s > unlink(path_bare, recursive = TRUE) 249s > unlink(path_repo_1, recursive = TRUE) 249s > unlink(path_repo_2, recursive = TRUE) 249s > 249s BEGIN TEST graph.R 249s 249s R version 4.4.3 (2025-02-28) -- "Trophy Case" 249s Copyright (C) 2025 The R Foundation for Statistical Computing 249s Platform: s390x-ibm-linux-gnu 249s 249s R is free software and comes with ABSOLUTELY NO WARRANTY. 249s You are welcome to redistribute it under certain conditions. 249s Type 'license()' or 'licence()' for distribution details. 249s 249s R is a collaborative project with many contributors. 249s Type 'contributors()' for more information and 249s 'citation()' on how to cite R or R packages in publications. 249s 249s Type 'demo()' for some demos, 'help()' for on-line help, or 249s 'help.start()' for an HTML browser interface to help. 249s Type 'q()' to quit R. 249s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library("git2r") 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > ## Create a directory in tempdir 249s > path <- tempfile(pattern = "git2r-") 249s > dir.create(path) 249s > 249s > ## Initialize a repository 249s > repo <- init(path) 249s > config(repo, user.name = "Alice", user.email = "alice@example.org") 249s > 249s > ## Create a file and commit 249s > writeLines("Hello world!", file.path(path, "test.txt")) 249s > add(repo, "test.txt") 249s > commit_1 <- commit(repo, "First commit message") 249s > tag_1 <- tag(repo, "Tagname1", "Tag message 1") 249s > 249s > ## Change file and commit 249s > writeLines(c("Hello world!", "HELLO WORLD!"), 249s + file.path(path, "test.txt")) 249s > add(repo, "test.txt") 249s > commit_2 <- commit(repo, "Second commit message") 249s > tag_2 <- tag(repo, "Tagname2", "Tag message 2") 249s > 249s > ## Check ahead behind 249s > stopifnot(identical(ahead_behind(commit_1, commit_2), c(0L, 1L))) 249s > stopifnot(identical(ahead_behind(tag_1, tag_2), c(0L, 1L))) 249s > stopifnot(identical(ahead_behind(tag_2, tag_1), c(1L, 0L))) 249s > stopifnot(identical(ahead_behind(commit_1, branches(repo)[[1]]), c(0L, 1L))) 249s > stopifnot(identical(ahead_behind(branches(repo)[[1]], commit_1), c(1L, 0L))) 249s > 249s > ## Cleanup 249s > unlink(path, recursive = TRUE) 249s > 249s BEGIN TEST index.R 249s 249s R version 4.4.3 (2025-02-28) -- "Trophy Case" 249s Copyright (C) 2025 The R Foundation for Statistical Computing 249s Platform: s390x-ibm-linux-gnu 249s 249s R is free software and comes with ABSOLUTELY NO WARRANTY. 249s You are welcome to redistribute it under certain conditions. 249s Type 'license()' or 'licence()' for distribution details. 249s 249s R is a collaborative project with many contributors. 249s Type 'contributors()' for more information and 249s 'citation()' on how to cite R or R packages in publications. 249s 249s Type 'demo()' for some demos, 'help()' for on-line help, or 249s 'help.start()' for an HTML browser interface to help. 249s Type 'q()' to quit R. 249s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library(git2r) 249s > source("util/check.R") 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > ## Create a directory in tempdir 249s > path <- tempfile(pattern = "git2r-") 249s > dir.create(path) 249s > 249s > ## Initialize a repository 249s > repo <- init(path) 249s > config(repo, user.name = "Alice", user.email = "alice@example.org") 249s > 249s > ## Create directories 249s > dir.create(file.path(path, "sub-folder")); 249s > dir.create(file.path(path, "sub-folder", "sub-sub-folder")); 249s > 249s > ## Create files 249s > writeLines("Hello world!", 249s + file.path(path, "file-1.txt")) 249s > writeLines("Hello world!", 249s + file.path(path, "sub-folder", "file-2.txt")) 249s > writeLines("Hello world!", 249s + file.path(path, "sub-folder", "file-3.txt")) 249s > writeLines("Hello world!", 249s + file.path(path, "sub-folder", "sub-sub-folder", "file-4.txt")) 249s > writeLines("Hello world!", 249s + file.path(path, "sub-folder", "sub-sub-folder", "file-5.txt")) 249s > 249s > ## Add 249s > add(repo, "file-1.txt") 249s > status_exp <- structure(list(staged = list(new = "file-1.txt"), 249s + unstaged = empty_named_list(), 249s + untracked = list(untracked = "sub-folder/")), 249s + class = "git_status") 249s > status_obs <- status(repo) 249s > stopifnot(identical(status_obs, status_exp)) 249s > 249s > ## Index remove by path 249s > index_remove_bypath(repo, "file-1.txt") 249s > status_exp <- structure(list(staged = empty_named_list(), 249s + unstaged = empty_named_list(), 249s + untracked = list(untracked = "file-1.txt", 249s + untracked = "sub-folder/")), 249s + class = "git_status") 249s > status_obs <- status(repo) 249s > stopifnot(identical(status_obs, status_exp)) 249s > 249s > ## Add 249s > add(repo, "sub-folder") 249s > status_exp <- structure(list(staged = list( 249s + new = "sub-folder/file-2.txt", 249s + new = "sub-folder/file-3.txt", 249s + new = "sub-folder/sub-sub-folder/file-4.txt", 249s + new = "sub-folder/sub-sub-folder/file-5.txt"), 249s + unstaged = empty_named_list(), 249s + untracked = list(untracked = "file-1.txt")), 249s + class = "git_status") 249s > status_obs <- status(repo) 249s > stopifnot(identical(status_obs, status_exp)) 249s > 249s > ## Commit 249s > commit(repo, "First commit message") 249s [31ace62] 2025-03-15: First commit message 249s > 249s > ## It should fail to remove non-existing, untracked and ignored files 249s > tools::assertError(rm_file(repo, c("file-1.txt", "file-2.txt"))) 249s > tools::assertError(rm_file(repo, c("file-1.txt", ""))) 249s > tools::assertError(rm_file(repo, c("file-1.txt"))) 249s > writeLines("/file-1.txt", file.path(path, ".gitignore")) 249s > tools::assertError(rm_file(repo, "file-1.txt")) 249s > 249s > ## It should fail to remove files with staged changes 249s > file.remove(file.path(path, ".gitignore")) 249s [1] TRUE 249s > add(repo, "file-1.txt") 249s > tools::assertError(rm_file(repo, "file-1.txt")) 249s > 249s > ## It should fail to remove files with unstaged changes 249s > commit(repo, "Second commit message") 249s [c87c039] 2025-03-15: Second commit message 249s > writeLines(c("Hello world!", "Hello world!"), 249s + file.path(path, "file-1.txt")) 249s > tools::assertError(rm_file(repo, "file-1.txt")) 249s > 249s > ## Remove file 249s > add(repo, "file-1.txt") 249s > commit(repo, "Third commit message") 249s [55d6ce0] 2025-03-15: Third commit message 249s > rm_file(repo, "file-1.txt") 249s > status_exp <- structure(list(staged = list(deleted = "file-1.txt"), 249s + unstaged = empty_named_list(), 249s + untracked = empty_named_list()), 249s + class = "git_status") 249s > status_obs <- status(repo) 249s > stopifnot(identical(status_obs, status_exp)) 249s > 249s > ## Cleanup 249s > unlink(path, recursive = TRUE) 249s > 249s BEGIN TEST invalid-conf-var.R 249s 249s R version 4.4.3 (2025-02-28) -- "Trophy Case" 249s Copyright (C) 2025 The R Foundation for Statistical Computing 249s Platform: s390x-ibm-linux-gnu 249s 249s R is free software and comes with ABSOLUTELY NO WARRANTY. 249s You are welcome to redistribute it under certain conditions. 249s Type 'license()' or 'licence()' for distribution details. 249s 249s R is a collaborative project with many contributors. 249s Type 'contributors()' for more information and 249s 'citation()' on how to cite R or R packages in publications. 249s 249s Type 'demo()' for some demos, 'help()' for on-line help, or 249s 'help.start()' for an HTML browser interface to help. 249s Type 'q()' to quit R. 249s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library("git2r") 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > ## Create a directory in tempdir 249s > path <- tempfile(pattern = "git2r-") 249s > dir.create(path) 249s > 249s > ## Initialize a repository 249s > repo <- init(path) 249s > 249s > ## Config repository 249s > config(repo, user.name = "Alice") 249s > 249s > ## Let's set one valid and one with variable with invalid format 249s > res <- tools::assertWarning(config(repo, 249s + user.email = "alice@example.org", 249s + lol = "wut")) 249s > stopifnot(length(grep("Variable was not in a valid format: 'lol'", 249s + res[[1]]$message)) > 0) 249s > 249s > cfg_exp <- structure(list(user.name = "Alice", 249s + user.email = "alice@example.org", 249s + "NA" = NULL), 249s + .Names = c("user.name", "user.email", NA)) 249s > 249s > cfg_obs <- config(repo)$local 249s > cfg_obs <- cfg_obs[c("user.name", "user.email", "lol")] 249s > stopifnot(identical(cfg_obs, cfg_exp)) 249s > 249s > ## Cleanup 249s > unlink(path, recursive = TRUE) 249s > 249s BEGIN TEST libgit2.R 249s 249s R version 4.4.3 (2025-02-28) -- "Trophy Case" 249s Copyright (C) 2025 The R Foundation for Statistical Computing 249s Platform: s390x-ibm-linux-gnu 249s 249s R is free software and comes with ABSOLUTELY NO WARRANTY. 249s You are welcome to redistribute it under certain conditions. 249s Type 'license()' or 'licence()' for distribution details. 249s 249s R is a collaborative project with many contributors. 249s Type 'contributors()' for more information and 249s 'citation()' on how to cite R or R packages in publications. 249s 249s Type 'demo()' for some demos, 'help()' for on-line help, or 249s 'help.start()' for an HTML browser interface to help. 249s Type 'q()' to quit R. 249s 249s > ## git2r, R bindings to the libgit2 library. 249s > ## Copyright (C) 2013-2023 The git2r contributors 249s > ## 249s > ## This program is free software; you can redistribute it and/or modify 249s > ## it under the terms of the GNU General Public License, version 2, 249s > ## as published by the Free Software Foundation. 249s > ## 249s > ## git2r is distributed in the hope that it will be useful, 249s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 249s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 249s > ## GNU General Public License for more details. 249s > ## 249s > ## You should have received a copy of the GNU General Public License along 249s > ## with this program; if not, write to the Free Software Foundation, Inc., 249s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 249s > 249s > library("git2r") 249s > 249s > ## For debugging 249s > sessionInfo() 249s R version 4.4.3 (2025-02-28) 249s Platform: s390x-ibm-linux-gnu 249s Running under: Ubuntu Plucky Puffin (development branch) 249s 249s Matrix products: default 249s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 249s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 249s 249s locale: 249s [1] C 249s 249s time zone: Etc/UTC 249s tzcode source: system (glibc) 249s 249s attached base packages: 249s [1] stats graphics grDevices utils datasets methods base 249s 249s other attached packages: 249s [1] git2r_0.35.0 249s 249s loaded via a namespace (and not attached): 249s [1] compiler_4.4.3 249s > libgit2_version() 249s $major 249s [1] 1 249s 249s $minor 249s [1] 9 249s 249s $rev 249s [1] 0 249s 249s > libgit2_features() 249s $threads 249s [1] TRUE 249s 249s $https 249s [1] TRUE 249s 249s $ssh 249s [1] TRUE 249s 249s > 249s > 249s > stopifnot(identical(names(libgit2_features()), 249s + c("threads", "https", "ssh"))) 249s > 249s > stopifnot(identical(names(libgit2_version()), 249s + c("major", "minor", "rev"))) 249s > 249s > tools::assertError(ssl_cert_locations()) 249s > 249s > if (identical(Sys.getenv("R_COVR"), "true")) { 249s + if (isTRUE(libgit2_features()$https)) { 249s + ## Create a directory in tempdir 249s + path <- tempfile(pattern = "git2r-") 249s + dir.create(path) 249s + stopifnot(is.null(ssl_cert_locations(path = path))) 249s + unlink(path) 249s + } 249s + } 249s > 250s BEGIN TEST ls_tree.R 250s 250s R version 4.4.3 (2025-02-28) -- "Trophy Case" 250s Copyright (C) 2025 The R Foundation for Statistical Computing 250s Platform: s390x-ibm-linux-gnu 250s 250s R is free software and comes with ABSOLUTELY NO WARRANTY. 250s You are welcome to redistribute it under certain conditions. 250s Type 'license()' or 'licence()' for distribution details. 250s 250s R is a collaborative project with many contributors. 250s Type 'contributors()' for more information and 250s 'citation()' on how to cite R or R packages in publications. 250s 250s Type 'demo()' for some demos, 'help()' for on-line help, or 250s 'help.start()' for an HTML browser interface to help. 250s Type 'q()' to quit R. 250s 250s > ## git2r, R bindings to the libgit2 library. 250s > ## Copyright (C) 2013-2023 The git2r contributors 250s > ## 250s > ## This program is free software; you can redistribute it and/or modify 250s > ## it under the terms of the GNU General Public License, version 2, 250s > ## as published by the Free Software Foundation. 250s > ## 250s > ## git2r is distributed in the hope that it will be useful, 250s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 250s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 250s > ## GNU General Public License for more details. 250s > ## 250s > ## You should have received a copy of the GNU General Public License along 250s > ## with this program; if not, write to the Free Software Foundation, Inc., 250s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 250s > 250s > library("git2r") 250s > 250s > ## For debugging 250s > sessionInfo() 250s R version 4.4.3 (2025-02-28) 250s Platform: s390x-ibm-linux-gnu 250s Running under: Ubuntu Plucky Puffin (development branch) 250s 250s Matrix products: default 250s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 250s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 250s 250s locale: 250s [1] C 250s 250s time zone: Etc/UTC 250s tzcode source: system (glibc) 250s 250s attached base packages: 250s [1] stats graphics grDevices utils datasets methods base 250s 250s other attached packages: 250s [1] git2r_0.35.0 250s 250s loaded via a namespace (and not attached): 250s [1] compiler_4.4.3 250s > libgit2_version() 250s $major 250s [1] 1 250s 250s $minor 250s [1] 9 250s 250s $rev 250s [1] 0 250s 250s > libgit2_features() 250s $threads 250s [1] TRUE 250s 250s $https 250s [1] TRUE 250s 250s $ssh 250s [1] TRUE 250s 250s > 250s > 250s > ## Initialize a temporary repository 250s > path <- tempfile(pattern = "git2r-") 250s > dir.create(path) 250s > dir.create(file.path(path, "subfolder")) 250s > repo <- init(path) 250s > 250s > ## Create a user 250s > config(repo, user.name = "Alice", user.email = "alice@example.org") 250s > 250s > ## Create three files and commit 250s > writeLines("First file", file.path(path, "example-1.txt")) 250s > writeLines("Second file", file.path(path, "subfolder/example-2.txt")) 250s > writeLines("Third file", file.path(path, "example-3.txt")) 250s > add(repo, c("example-1.txt", "subfolder/example-2.txt", "example-3.txt")) 250s > commit(repo, "Commit message") 250s [758164e] 2025-03-15: Commit message 250s > 250s > ## Traverse tree entries and its subtrees. 250s > ## Various approaches that give identical result. 250s > stopifnot(identical(ls_tree(tree = tree(last_commit(path))), 250s + ls_tree(tree = tree(last_commit(repo))))) 250s > stopifnot(identical(ls_tree(repo = path), ls_tree(repo = repo))) 250s > 250s > ## ls_tree(repo = repo) should match `git ls-tree -lr HEAD` 250s > ls_tree_result <- ls_tree(repo = repo) 250s > stopifnot(identical(ls_tree_result$name, 250s + c("example-1.txt", "example-3.txt", "example-2.txt"))) 250s > 250s > # Argument `tree` can be a 'character that identifies a tree in the repository' 250s > ls_tree(tree = tree(last_commit(path))$sha, repo = repo) 250s mode type sha path name 250s 1 100644 blob 4c5fd919d52e3c1b08f7924cfa05d6de100912fd example-1.txt 250s 2 100644 blob f89598da398eb016c504a5e272cb3eb1a31e2687 example-3.txt 250s 3 100644 blob 20d5b672a347112783818b3fc8cc7cd66ade3008 subfolder/ example-2.txt 250s len 250s 1 11 250s 2 11 250s 3 12 250s > 250s > ## Skip content in subfolder 250s > ls_tree_toplevel <- ls_tree(repo = repo, recursive = FALSE) 250s > stopifnot(nrow(ls_tree_toplevel) == 3) 250s > stopifnot(identical(ls_tree_toplevel$name, 250s + c("example-1.txt", "example-3.txt", "subfolder"))) 250s > 250s > ## Start in subfolder 250s > ls_tree_subfolder <- ls_tree(tree = "HEAD:subfolder", repo = repo) 250s > stopifnot(nrow(ls_tree_subfolder) == 1) 250s > stopifnot(identical(ls_tree_subfolder$name, "example-2.txt")) 250s > 250s > ## Cleanup 250s > unlink(path, recursive = TRUE) 250s > 250s BEGIN TEST merge.R 250s 250s R version 4.4.3 (2025-02-28) -- "Trophy Case" 250s Copyright (C) 2025 The R Foundation for Statistical Computing 250s Platform: s390x-ibm-linux-gnu 250s 250s R is free software and comes with ABSOLUTELY NO WARRANTY. 250s You are welcome to redistribute it under certain conditions. 250s Type 'license()' or 'licence()' for distribution details. 250s 250s R is a collaborative project with many contributors. 250s Type 'contributors()' for more information and 250s 'citation()' on how to cite R or R packages in publications. 250s 250s Type 'demo()' for some demos, 'help()' for on-line help, or 250s 'help.start()' for an HTML browser interface to help. 250s Type 'q()' to quit R. 250s 250s > ## git2r, R bindings to the libgit2 library. 250s > ## Copyright (C) 2013-2023 The git2r contributors 250s > ## 250s > ## This program is free software; you can redistribute it and/or modify 250s > ## it under the terms of the GNU General Public License, version 2, 250s > ## as published by the Free Software Foundation. 250s > ## 250s > ## git2r is distributed in the hope that it will be useful, 250s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 250s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 250s > ## GNU General Public License for more details. 250s > ## 250s > ## You should have received a copy of the GNU General Public License along 250s > ## with this program; if not, write to the Free Software Foundation, Inc., 250s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 250s > 250s > library(git2r) 250s > source("util/check.R") 250s > 250s > ## For debugging 250s > sessionInfo() 250s R version 4.4.3 (2025-02-28) 250s Platform: s390x-ibm-linux-gnu 250s Running under: Ubuntu Plucky Puffin (development branch) 250s 250s Matrix products: default 250s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 250s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 250s 250s locale: 250s [1] C 250s 250s time zone: Etc/UTC 250s tzcode source: system (glibc) 250s 250s attached base packages: 250s [1] stats graphics grDevices utils datasets methods base 250s 250s other attached packages: 250s [1] git2r_0.35.0 250s 250s loaded via a namespace (and not attached): 250s [1] compiler_4.4.3 250s > libgit2_version() 250s $major 250s [1] 1 250s 250s $minor 250s [1] 9 250s 250s $rev 250s [1] 0 250s 250s > libgit2_features() 250s $threads 250s [1] TRUE 250s 250s $https 250s [1] TRUE 250s 250s $ssh 250s [1] TRUE 250s 250s > 250s > 250s > ## Create a directory in tempdir 250s > path <- tempfile(pattern = "git2r-") 250s > dir.create(path) 250s > 250s > ## Initialize a repository 250s > repo <- init(path, branch = "main") 250s > config(repo, user.name = "Alice", user.email = "alice@example.org") 250s > 250s > ## Create a file, add and commit 250s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit_1 <- commit(repo, "Commit message 1") 250s > 250s > ## Create first branch, checkout, add file and commit 250s > b_1 <- branch_create(commit_1, "branch1") 250s > checkout(b_1) 250s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 250s > add(repo, "branch-1.txt") 250s > commit_2 <- commit(repo, "Commit message branch 1") 250s > 250s > ## Create second branch, checkout, add file and commit 250s > b_2 <- branch_create(commit_1, "branch2") 250s > checkout(b_2) 250s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 250s > add(repo, "branch-2.txt") 250s > commit_3 <- commit(repo, "Commit message branch 2") 250s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit_4 <- commit(repo, "Second commit message branch 2") 250s > 250s > ## Check that merge base equals commit_1 250s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 250s > 250s > ## Checkout main 250s > b <- branches(repo) 250s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 250s > 250s > ## Merge branch 1 250s > m_1 <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 250s > stopifnot(identical(m_1$fast_forward, TRUE)) 250s > stopifnot(identical(m_1$conflicts, FALSE)) 250s > stopifnot(identical(sha(m_1), NA_character_)) 250s > stopifnot(identical(print(m_1), m_1)) 250s Merge: Fast-forward 250s > 250s > ## Merge branch 1 again 250s > m_1_again <- merge(b[sapply(b, "[", "name") == "branch1"][[1]]) 250s > stopifnot(identical(m_1_again$up_to_date, TRUE)) 250s > stopifnot(identical(m_1_again$fast_forward, FALSE)) 250s > stopifnot(identical(m_1_again$conflicts, FALSE)) 250s > stopifnot(identical(sha(m_1_again), NA_character_)) 250s > 250s > ## Merge branch 2 250s > m_2 <- merge(b[sapply(b, "[", "name") == "branch2"][[1]]) 250s > stopifnot(identical(m_2$fast_forward, FALSE)) 250s > stopifnot(identical(m_2$conflicts, FALSE)) 250s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 250s > 250s > ## Create third branch, checkout, change file and commit 250s > b_3 <- branch_create(lookup(repo, sha(m_2)), "branch3") 250s > checkout(b_3) 250s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit(repo, "Commit message branch 3") 250s [f55a829] 2025-03-15: Commit message branch 3 250s > 250s > ## Checkout main and create a change that creates a conflict on 250s > ## merge 250s > b <- branches(repo) 250s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 250s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit(repo, "Some commit message branch 1") 250s [6aa7dd3] 2025-03-15: Some commit message branch 1 250s > 250s > ## Merge branch 3 with fail = TRUE 250s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]], fail = TRUE) 250s > stopifnot(identical(m_3$up_to_date, FALSE)) 250s > stopifnot(identical(m_3$fast_forward, FALSE)) 250s > stopifnot(identical(m_3$conflicts, TRUE)) 250s > stopifnot(identical(sha(m_3), NA_character_)) 250s > m_3 250s Merge: Conflicts 250s > 250s > ## Check status; Expect to have a clean working directory 250s > wd <- structure(list(staged = empty_named_list(), 250s + unstaged = empty_named_list(), 250s + untracked = empty_named_list()), 250s + class = "git_status") 250s > stopifnot(identical(status(repo), wd)) 250s > 250s > ## Merge branch 3 250s > m_3 <- merge(b[sapply(b, "[", "name") == "branch3"][[1]]) 250s > stopifnot(identical(m_3$up_to_date, FALSE)) 250s > stopifnot(identical(m_3$fast_forward, FALSE)) 250s > stopifnot(identical(m_3$conflicts, TRUE)) 250s > stopifnot(identical(sha(m_3), NA_character_)) 250s > m_3 250s Merge: Conflicts 250s > 250s > ## Check status; Expect to have one unstaged unmerged conflict. 250s > stopifnot(identical(status(repo), 250s + structure(list(staged = empty_named_list(), 250s + unstaged = list(conflicted = "test.txt"), 250s + untracked = empty_named_list()), 250s + class = "git_status"))) 250s > 250s > ## Cleanup 250s > unlink(path, recursive = TRUE) 250s > 250s BEGIN TEST merge_named_branch.R 250s 250s R version 4.4.3 (2025-02-28) -- "Trophy Case" 250s Copyright (C) 2025 The R Foundation for Statistical Computing 250s Platform: s390x-ibm-linux-gnu 250s 250s R is free software and comes with ABSOLUTELY NO WARRANTY. 250s You are welcome to redistribute it under certain conditions. 250s Type 'license()' or 'licence()' for distribution details. 250s 250s R is a collaborative project with many contributors. 250s Type 'contributors()' for more information and 250s 'citation()' on how to cite R or R packages in publications. 250s 250s Type 'demo()' for some demos, 'help()' for on-line help, or 250s 'help.start()' for an HTML browser interface to help. 250s Type 'q()' to quit R. 250s 250s > ## git2r, R bindings to the libgit2 library. 250s > ## Copyright (C) 2013-2023 The git2r contributors 250s > ## 250s > ## This program is free software; you can redistribute it and/or modify 250s > ## it under the terms of the GNU General Public License, version 2, 250s > ## as published by the Free Software Foundation. 250s > ## 250s > ## git2r is distributed in the hope that it will be useful, 250s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 250s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 250s > ## GNU General Public License for more details. 250s > ## 250s > ## You should have received a copy of the GNU General Public License along 250s > ## with this program; if not, write to the Free Software Foundation, Inc., 250s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 250s > 250s > library(git2r) 250s > source("util/check.R") 250s > 250s > ## For debugging 250s > sessionInfo() 250s R version 4.4.3 (2025-02-28) 250s Platform: s390x-ibm-linux-gnu 250s Running under: Ubuntu Plucky Puffin (development branch) 250s 250s Matrix products: default 250s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 250s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 250s 250s locale: 250s [1] C 250s 250s time zone: Etc/UTC 250s tzcode source: system (glibc) 250s 250s attached base packages: 250s [1] stats graphics grDevices utils datasets methods base 250s 250s other attached packages: 250s [1] git2r_0.35.0 250s 250s loaded via a namespace (and not attached): 250s [1] compiler_4.4.3 250s > libgit2_version() 250s $major 250s [1] 1 250s 250s $minor 250s [1] 9 250s 250s $rev 250s [1] 0 250s 250s > libgit2_features() 250s $threads 250s [1] TRUE 250s 250s $https 250s [1] TRUE 250s 250s $ssh 250s [1] TRUE 250s 250s > 250s > 250s > ## Create a directory in tempdir 250s > path <- tempfile(pattern = "git2r-") 250s > dir.create(path) 250s > 250s > ## Initialize a repository 250s > repo <- init(path, branch = "main") 250s > config(repo, user.name = "Alice", user.email = "alice@example.org") 250s > 250s > ## Create a file, add and commit 250s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit_1 <- commit(repo, "Commit message 1") 250s > 250s > ## Create first branch, checkout, add file and commit 250s > checkout(repo, "branch1", create = TRUE) 250s > writeLines("Branch 1", file.path(path, "branch-1.txt")) 250s > add(repo, "branch-1.txt") 250s > commit_2 <- commit(repo, "Commit message branch 1") 250s > 250s > ## Create second branch, checkout, add file and commit 250s > b_2 <- branch_create(commit_1, "branch2") 250s > checkout(b_2) 250s > writeLines("Branch 2", file.path(path, "branch-2.txt")) 250s > add(repo, "branch-2.txt") 250s > commit_3 <- commit(repo, "Commit message branch 2") 250s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit_4 <- commit(repo, "Second commit message branch 2") 250s > 250s > ## Check that merge base equals commit_1 250s > stopifnot(identical(merge_base(commit_2, commit_3), commit_1)) 250s > 250s > ## Checkout main 250s > b <- branches(repo) 250s > checkout(b[sapply(b, "[", "name") == "main"][[1]], force = TRUE) 250s > 250s > ## Merge branch 1 250s > m_1 <- merge(repo, "branch1") 250s > stopifnot(identical(m_1$fast_forward, TRUE)) 250s > stopifnot(identical(m_1$conflicts, FALSE)) 250s > stopifnot(identical(sha(m_1), NA_character_)) 250s > 250s > ## Merge branch 2 250s > m_2 <- merge(path, "branch2") 250s > stopifnot(identical(m_2$fast_forward, FALSE)) 250s > stopifnot(identical(m_2$conflicts, FALSE)) 250s > stopifnot(identical(sha(m_2), sha(commits(repo)[[1]]))) 250s > 250s > ## Create third branch, checkout, change file and commit 250s > checkout(repo, "branch3", create = TRUE) 250s > writeLines(c("Lorem ipsum dolor amet sit, consectetur adipisicing elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit(repo, "Commit message branch 3") 250s [f55a829] 2025-03-15: Commit message branch 3 250s > 250s > ## Checkout main and create a change that creates a merge conflict 250s > checkout(repo, "main", force = TRUE) 250s > writeLines(c("Lorem ipsum dolor sit amet, adipisicing consectetur elit, sed do", 250s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 250s + con = file.path(path, "test.txt")) 250s > add(repo, "test.txt") 250s > commit(repo, "Some commit message branch 1") 250s [6aa7dd3] 2025-03-15: Some commit message branch 1 250s > 250s > ## Merge branch 3 250s > m_3 <- merge(repo, "branch3") 250s > stopifnot(identical(m_3$up_to_date, FALSE)) 250s > stopifnot(identical(m_3$fast_forward, FALSE)) 250s > stopifnot(identical(m_3$conflicts, TRUE)) 250s > stopifnot(identical(sha(m_3), NA_character_)) 250s > 250s > ## Check status; Expect to have one unstaged unmerged conflict. 250s > stopifnot(identical(status(repo), 250s + structure(list(staged = empty_named_list(), 250s + unstaged = list(conflicted = "test.txt"), 250s + untracked = empty_named_list()), 250s + class = "git_status"))) 250s > 250s > ## Cleanup 250s > unlink(path, recursive = TRUE) 250s > 250s BEGIN TEST normal_merge.R 250s 250s R version 4.4.3 (2025-02-28) -- "Trophy Case" 250s Copyright (C) 2025 The R Foundation for Statistical Computing 250s Platform: s390x-ibm-linux-gnu 250s 250s R is free software and comes with ABSOLUTELY NO WARRANTY. 250s You are welcome to redistribute it under certain conditions. 250s Type 'license()' or 'licence()' for distribution details. 250s 250s R is a collaborative project with many contributors. 250s Type 'contributors()' for more information and 250s 'citation()' on how to cite R or R packages in publications. 250s 250s Type 'demo()' for some demos, 'help()' for on-line help, or 250s 'help.start()' for an HTML browser interface to help. 250s Type 'q()' to quit R. 250s 250s > ## git2r, R bindings to the libgit2 library. 250s > ## Copyright (C) 2013-2023 The git2r contributors 250s > ## 250s > ## This program is free software; you can redistribute it and/or modify 250s > ## it under the terms of the GNU General Public License, version 2, 250s > ## as published by the Free Software Foundation. 250s > ## 250s > ## git2r is distributed in the hope that it will be useful, 250s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 250s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 250s > ## GNU General Public License for more details. 250s > ## 250s > ## You should have received a copy of the GNU General Public License along 250s > ## with this program; if not, write to the Free Software Foundation, Inc., 250s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 250s > 250s > library(git2r) 250s > 250s > ## For debugging 250s > sessionInfo() 250s R version 4.4.3 (2025-02-28) 250s Platform: s390x-ibm-linux-gnu 250s Running under: Ubuntu Plucky Puffin (development branch) 250s 250s Matrix products: default 250s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 250s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 250s 250s locale: 250s [1] C 250s 250s time zone: Etc/UTC 250s tzcode source: system (glibc) 250s 250s attached base packages: 250s [1] stats graphics grDevices utils datasets methods base 250s 250s other attached packages: 250s [1] git2r_0.35.0 250s 250s loaded via a namespace (and not attached): 250s [1] compiler_4.4.3 250s > libgit2_version() 250s $major 250s [1] 1 250s 250s $minor 250s [1] 9 250s 250s $rev 250s [1] 0 250s 250s > libgit2_features() 250s $threads 250s [1] TRUE 250s 250s $https 250s [1] TRUE 250s 250s $ssh 250s [1] TRUE 250s 250s > 250s > 250s > ## Initialize a temporary repository 250s > path <- tempfile(pattern = "git2r-") 250s > dir.create(path) 250s > repo <- init(path, branch = "main") 250s > 250s > ## Create a user and commit a file 250s > config(repo, user.name = "Author", user.email = "author@example.org") 250s > writeLines(c("First line in file 1.", "Second line in file 1."), 250s + file.path(path, "example-1.txt")) 250s > add(repo, "example-1.txt") 250s > commit(repo, "First commit message") 250s [ba0e9b4] 2025-03-15: First commit message 250s > 250s > ## Create and add one more file 250s > writeLines(c("First line in file 2.", "Second line in file 2."), 250s + file.path(path, "example-2.txt")) 250s > add(repo, "example-2.txt") 250s > commit(repo, "Second commit message") 250s [c21b57d] 2025-03-15: Second commit message 250s > 250s > ## Create a new branch 'fix' 250s > checkout(repo, "fix", create = TRUE) 250s > 250s > ## Update 'example-1.txt' (swap words in first line) and commit 250s > writeLines(c("line First in file 1.", "Second line in file 1."), 250s + file.path(path, "example-1.txt")) 250s > add(repo, "example-1.txt") 250s > commit(repo, "Third commit message") 250s [4f9be7c] 2025-03-15: Third commit message 250s > 250s > checkout(repo, "main") 250s > 250s > ## Update 'example-2.txt' (swap words in second line) and commit 250s > writeLines(c("First line in file 2.", "line Second in file 2."), 250s + file.path(path, "example-2.txt")) 250s > add(repo, "example-2.txt") 250s > commit(repo, "Fourth commit message") 250s [4b3571b] 2025-03-15: Fourth commit message 250s > 250s > # Missing branch to merge with should throw an error 250s > tools::assertError(merge(repo)) 250s > 250s > ## Merge 'fix' 250s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 250s > stopifnot(identical(format(m), "Merge")) 250s > 250s > ## Merge 'fix' again 250s > m <- merge(repo, "fix", TRUE, default_signature(repo)) 250s > stopifnot(identical(format(m), "Already up-to-date")) 250s > 250s > ## Check number of parents of each commit 250s > stopifnot(identical(sapply(commits(repo), function(x) length(parents(x))), 250s + c(2L, 1L, 1L, 1L, 0L))) 250s > 250s > ## Check that last commit is a merge 250s > stopifnot(is_merge(last_commit(repo))) 250s > summary(last_commit(repo)) 250s Commit: b6ed53cad4c13f6e98c32fbc5664030ced2ffb8d 250s Merge: 4b3571b8370de83bbf2f0efc704cb972a2789fbf 250s 4f9be7c73cc2c56754ce0d7ce9e89b42a302b18b 250s Author: Author 250s When: 2025-03-15 18:07:57 GMT 250s 250s merge fix 250s 250s Commit message: 4b3571b8370de83bbf2f0efc704cb972a2789fbf 250s Fourth commit message 250s 250s Commit message: 4f9be7c73cc2c56754ce0d7ce9e89b42a302b18b 250s Third commit message 250s 250s > 250s > ## Check that metadata associated with merge is removed 250s > stopifnot(!file.exists(file.path(path, ".git", "MERGE_HEAD"))) 250s > 250s > ## Cleanup 250s > unlink(path, recursive = TRUE) 250s > 250s BEGIN TEST note.R 250s 250s R version 4.4.3 (2025-02-28) -- "Trophy Case" 250s Copyright (C) 2025 The R Foundation for Statistical Computing 250s Platform: s390x-ibm-linux-gnu 250s 250s R is free software and comes with ABSOLUTELY NO WARRANTY. 250s You are welcome to redistribute it under certain conditions. 250s Type 'license()' or 'licence()' for distribution details. 250s 250s R is a collaborative project with many contributors. 250s Type 'contributors()' for more information and 250s 'citation()' on how to cite R or R packages in publications. 250s 250s Type 'demo()' for some demos, 'help()' for on-line help, or 250s 'help.start()' for an HTML browser interface to help. 250s Type 'q()' to quit R. 250s 250s > ## git2r, R bindings to the libgit2 library. 250s > ## Copyright (C) 2013-2023 The git2r contributors 250s > ## 250s > ## This program is free software; you can redistribute it and/or modify 250s > ## it under the terms of the GNU General Public License, version 2, 250s > ## as published by the Free Software Foundation. 250s > ## 250s > ## git2r is distributed in the hope that it will be useful, 250s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 250s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 250s > ## GNU General Public License for more details. 250s > ## 250s > ## You should have received a copy of the GNU General Public License along 250s > ## with this program; if not, write to the Free Software Foundation, Inc., 250s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 250s > 250s > library("git2r") 251s > 251s > ## For debugging 251s > sessionInfo() 251s R version 4.4.3 (2025-02-28) 251s Platform: s390x-ibm-linux-gnu 251s Running under: Ubuntu Plucky Puffin (development branch) 251s 251s Matrix products: default 251s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 251s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 251s 251s locale: 251s [1] C 251s 251s time zone: Etc/UTC 251s tzcode source: system (glibc) 251s 251s attached base packages: 251s [1] stats graphics grDevices utils datasets methods base 251s 251s other attached packages: 251s [1] git2r_0.35.0 251s 251s loaded via a namespace (and not attached): 251s [1] compiler_4.4.3 251s > libgit2_version() 251s $major 251s [1] 1 251s 251s $minor 251s [1] 9 251s 251s $rev 251s [1] 0 251s 251s > libgit2_features() 251s $threads 251s [1] TRUE 251s 251s $https 251s [1] TRUE 251s 251s $ssh 251s [1] TRUE 251s 251s > 251s > 251s > ## Create a directory in tempdir 251s > path <- tempfile(pattern = "git2r-") 251s > dir.create(path) 251s > 251s > ## Initialize a repository 251s > repo <- init(path) 251s > config(repo, user.name = "Alice", user.email = "alice@example.org") 251s > 251s > ## Create a file, add and commit 251s > writeLines("Hello world!", file.path(path, "test.txt")) 251s > add(repo, "test.txt") 251s > commit_1 <- commit(repo, "Commit message 1") 251s > 251s > ## Create another commit 251s > writeLines(c("Hello world!", 251s + "HELLO WORLD!"), 251s + file.path(path, "test.txt")) 251s > add(repo, "test.txt") 251s > commit_2 <- commit(repo, "Commit message 2") 251s > 251s > ## Check default ref 251s > stopifnot(identical(note_default_ref(repo), 251s + "refs/notes/commits")) 251s > 251s > ## Check that an invalid object argument in note_create produce an 251s > ## error. 251s > tools::assertError(note_create(object = NULL, message = "test")) 251s > tools::assertError(note_create(object = 1, message = "test")) 251s > 251s > ## Check that notes is an empty list 251s > stopifnot(identical(notes(repo), list())) 251s > 251s > ## Create note in default namespace 251s > note_1 <- note_create(commit_1, "Note-1") 251s > stopifnot(identical(print(note_1), note_1)) 251s note: a801dfb10a85d13bc8ab304a9255b5cf180f94dd 251s > stopifnot(identical(length(notes(repo)), 1L)) 251s > stopifnot(identical(sha(note_1), note_1$sha)) 251s > tools::assertError(note_create(commit_1, "Note-2")) 251s > note_2 <- note_create(commit_1, "Note-2", force = TRUE) 251s > stopifnot(identical(length(notes(repo)), 1L)) 251s > 251s > ## Check that an invalid note argument in note_remove produce an 251s > ## error. 251s > tools::assertError(note_remove(note = 1)) 251s > 251s > ## Create note in named (review) namespace 251s > note_3 <- note_create(commit_1, "Note-3", ref = "refs/notes/review") 251s > note_4 <- note_create(commit_2, "Note-4", ref = "refs/notes/review") 251s > stopifnot(identical(length(notes(repo, ref = "refs/notes/review")), 2L)) 251s > note_remove(note_3) 251s > note_remove(note_4) 251s > stopifnot(identical(notes(repo, ref = "refs/notes/review"), list())) 251s > note_5 <- note_create(commit_1, "Note-5", ref = "review") 251s > note_6 <- note_create(commit_2, "Note-6", ref = "review") 251s > stopifnot(identical(length(notes(repo, ref = "review")), 2L)) 251s > note_remove(note_5) 251s > note_remove(note_6) 251s > stopifnot(identical(length(notes(repo, ref = "review")), 0L)) 251s > 251s > ## Create note on blob and tree 251s > tree_1 <- tree(commit_1) 251s > note_7 <- note_create(tree_1, "Note-7") 251s > stopifnot(is(object = lookup(repo, note_7$annotated), class2 = "git_tree")) 251s > stopifnot(identical(length(notes(repo)), 2L)) 251s > blob_1 <- lookup(repo, tree_1$id[1]) 251s > note_8 <- note_create(blob_1, "Note-8") 251s > stopifnot(is(object = lookup(repo, note_8$annotated), class2 = "git_blob")) 251s > stopifnot(identical(length(notes(repo)), 3L)) 251s > 251s > ## Cleanup 251s > unlink(path, recursive = TRUE) 251s > 251s BEGIN TEST odb_blobs.R 251s 251s R version 4.4.3 (2025-02-28) -- "Trophy Case" 251s Copyright (C) 2025 The R Foundation for Statistical Computing 251s Platform: s390x-ibm-linux-gnu 251s 251s R is free software and comes with ABSOLUTELY NO WARRANTY. 251s You are welcome to redistribute it under certain conditions. 251s Type 'license()' or 'licence()' for distribution details. 251s 251s R is a collaborative project with many contributors. 251s Type 'contributors()' for more information and 251s 'citation()' on how to cite R or R packages in publications. 251s 251s Type 'demo()' for some demos, 'help()' for on-line help, or 251s 'help.start()' for an HTML browser interface to help. 251s Type 'q()' to quit R. 251s 251s > ## git2r, R bindings to the libgit2 library. 251s > ## Copyright (C) 2013-2023 The git2r contributors 251s > ## 251s > ## This program is free software; you can redistribute it and/or modify 251s > ## it under the terms of the GNU General Public License, version 2, 251s > ## as published by the Free Software Foundation. 251s > ## 251s > ## git2r is distributed in the hope that it will be useful, 251s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 251s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 251s > ## GNU General Public License for more details. 251s > ## 251s > ## You should have received a copy of the GNU General Public License along 251s > ## with this program; if not, write to the Free Software Foundation, Inc., 251s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 251s > 251s > library("git2r") 251s > 251s > ## For debugging 251s > sessionInfo() 251s R version 4.4.3 (2025-02-28) 251s Platform: s390x-ibm-linux-gnu 251s Running under: Ubuntu Plucky Puffin (development branch) 251s 251s Matrix products: default 251s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 251s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 251s 251s locale: 251s [1] C 251s 251s time zone: Etc/UTC 251s tzcode source: system (glibc) 251s 251s attached base packages: 251s [1] stats graphics grDevices utils datasets methods base 251s 251s other attached packages: 251s [1] git2r_0.35.0 251s 251s loaded via a namespace (and not attached): 251s [1] compiler_4.4.3 251s > libgit2_version() 251s $major 251s [1] 1 251s 251s $minor 251s [1] 9 251s 251s $rev 251s [1] 0 251s 251s > libgit2_features() 251s $threads 251s [1] TRUE 251s 251s $https 251s [1] TRUE 251s 251s $ssh 251s [1] TRUE 251s 251s > 251s > 251s > ## Create a directory in tempdir 251s > path <- tempfile(pattern = "git2r-") 251s > dir.create(path) 251s > 251s > ## Initialize a repository 251s > repo <- init(path) 251s > config(repo, user.name = "Alice", user.email = "alice@@example.org") 251s > 251s > ## Create a file, add and commit 251s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 251s + con = file.path(path, "test.txt")) 251s > add(repo, "test.txt") 251s > commit(repo, "Commit message 1") 251s [61bd2f2] 2025-03-15: Commit message 1 251s > 251s > ## Change file and commit 251s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 251s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 251s + con = file.path(path, "test.txt")) 251s > add(repo, "test.txt") 251s > commit(repo, "Commit message 2") 251s [fed4ae8] 2025-03-15: Commit message 2 251s > 251s > ## Commit same content under different name in a sub-directory 251s > dir.create(file.path(path, "sub-directory")) 251s > file.copy(file.path(path, "test.txt"), 251s + file.path(path, "sub-directory", "copy.txt")) 251s [1] TRUE 251s > add(repo, "sub-directory/copy.txt") 251s > commit(repo, "Commit message 3") 251s [fd02158] 2025-03-15: Commit message 3 251s > 251s > ## List blobs 251s > b <- odb_blobs(repo) 251s > 251s > ## Order the data.frame before checking 251s > b <- b[order(b$name), ] 251s > 251s > ## Check blobs 251s > stopifnot(identical(nrow(b), 3L)) 251s > stopifnot(identical( 251s + colnames(b), 251s + c("sha", "path", "name", "len", "commit", "author", "when"))) 251s > stopifnot(identical(b$path, c("sub-directory", "", ""))) 251s > stopifnot(identical(b$name, c("copy.txt", "test.txt", "test.txt"))) 251s > stopifnot(identical(b$author, c("Alice", "Alice", "Alice"))) 251s > 251s > ## Cleanup 251s > unlink(path, recursive = TRUE) 251s > 251s BEGIN TEST pre-process-path.R 251s 251s R version 4.4.3 (2025-02-28) -- "Trophy Case" 251s Copyright (C) 2025 The R Foundation for Statistical Computing 251s Platform: s390x-ibm-linux-gnu 251s 251s R is free software and comes with ABSOLUTELY NO WARRANTY. 251s You are welcome to redistribute it under certain conditions. 251s Type 'license()' or 'licence()' for distribution details. 251s 251s R is a collaborative project with many contributors. 251s Type 'contributors()' for more information and 251s 'citation()' on how to cite R or R packages in publications. 251s 251s Type 'demo()' for some demos, 'help()' for on-line help, or 251s 'help.start()' for an HTML browser interface to help. 251s Type 'q()' to quit R. 251s 251s > ## git2r, R bindings to the libgit2 library. 251s > ## Copyright (C) 2013-2023 The git2r contributors 251s > ## 251s > ## This program is free software; you can redistribute it and/or modify 251s > ## it under the terms of the GNU General Public License, version 2, 251s > ## as published by the Free Software Foundation. 251s > ## 251s > ## git2r is distributed in the hope that it will be useful, 251s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 251s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 251s > ## GNU General Public License for more details. 251s > ## 251s > ## You should have received a copy of the GNU General Public License along 251s > ## with this program; if not, write to the Free Software Foundation, Inc., 251s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 251s > 251s > library(git2r) 251s > source("util/check.R") 251s > 251s > ## For debugging 251s > sessionInfo() 251s R version 4.4.3 (2025-02-28) 251s Platform: s390x-ibm-linux-gnu 251s Running under: Ubuntu Plucky Puffin (development branch) 251s 251s Matrix products: default 251s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 251s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 251s 251s locale: 251s [1] C 251s 251s time zone: Etc/UTC 251s tzcode source: system (glibc) 251s 251s attached base packages: 251s [1] stats graphics grDevices utils datasets methods base 251s 251s other attached packages: 251s [1] git2r_0.35.0 251s 251s loaded via a namespace (and not attached): 251s [1] compiler_4.4.3 251s > libgit2_version() 251s $major 251s [1] 1 251s 251s $minor 251s [1] 9 251s 251s $rev 251s [1] 0 251s 251s > libgit2_features() 251s $threads 251s [1] TRUE 251s 251s $https 251s [1] TRUE 251s 251s $ssh 251s [1] TRUE 251s 251s > 251s > 251s > ## Create a directory in tempdir 251s > path <- tempfile(pattern = "git2r-") 251s > dir.create(path) 251s > setwd(path) 251s > 251s > ## Initialize a repository 251s > repo <- init(path) 251s > config(repo, user.name = "Alice", user.email = "alice@example.org") 251s > 251s > ## Test to add file with a leading './' 251s > writeLines("foo-1", file.path(path, "foo-1")) 251s > add(repo, "./foo-1") 251s > status_exp <- structure(list(staged = list(new = "foo-1"), 251s + unstaged = empty_named_list(), 251s + untracked = empty_named_list()), 251s + class = "git_status") 251s > status_obs <- status(repo) 251s > str(status_exp) 251s List of 3 251s $ staged :List of 1 251s ..$ new: chr "foo-1" 251s $ unstaged : Named list() 251s $ untracked: Named list() 251s - attr(*, "class")= chr "git_status" 251s > str(status_obs) 251s List of 3 251s $ staged :List of 1 251s ..$ new: chr "foo-1" 251s $ unstaged : Named list() 251s $ untracked: Named list() 251s - attr(*, "class")= chr "git_status" 251s > stopifnot(identical(status_obs, status_exp)) 251s > 251s > ## Test to add file in sub-folder with sub-folder as working directory 251s > writeLines("foo-2", file.path(path, "foo-2")) 251s > dir.create(file.path(path, "foo_dir")) 251s > writeLines("foo-2", file.path(path, "foo_dir/foo-2")) 251s > setwd("./foo_dir") 251s > add(repo, "foo-2") 251s > status_exp <- structure(list(staged = list(new = "foo-1", 251s + new = "foo_dir/foo-2"), 251s + unstaged = empty_named_list(), 251s + untracked = list(untracked = "foo-2")), 251s + class = "git_status") 251s > status_obs <- status(repo) 251s > str(status_exp) 251s List of 3 251s $ staged :List of 2 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > str(status_obs) 251s List of 3 251s $ staged :List of 2 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > stopifnot(identical(status_obs, status_exp)) 251s > 251s > ## Test glob expansion 251s > setwd(tempdir()) 251s > dir.create(file.path(path, "glob_dir")) 251s > writeLines("a", file.path(path, "glob_dir/a.txt")) 251s > writeLines("b", file.path(path, "glob_dir/b.txt")) 251s > writeLines("c", file.path(path, "glob_dir/c.txt")) 251s > writeLines("d", file.path(path, "glob_dir/d.md")) 251s > add(repo, "glob_dir/*txt") 251s > status_exp <- structure(list(staged = list(new = "foo-1", 251s + new = "foo_dir/foo-2", 251s + new = "glob_dir/a.txt", 251s + new = "glob_dir/b.txt", 251s + new = "glob_dir/c.txt"), 251s + unstaged = empty_named_list(), 251s + untracked = list(untracked = "foo-2", 251s + untracked = "glob_dir/d.md")), 251s + class = "git_status") 251s > status_obs <- status(repo) 251s > str(status_exp) 251s List of 3 251s $ staged :List of 5 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s $ unstaged : Named list() 251s $ untracked:List of 2 251s ..$ untracked: chr "foo-2" 251s ..$ untracked: chr "glob_dir/d.md" 251s - attr(*, "class")= chr "git_status" 251s > str(status_obs) 251s List of 3 251s $ staged :List of 5 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s $ unstaged : Named list() 251s $ untracked:List of 2 251s ..$ untracked: chr "foo-2" 251s ..$ untracked: chr "glob_dir/d.md" 251s - attr(*, "class")= chr "git_status" 251s > stopifnot(identical(status_obs, status_exp)) 251s > 251s > ## Test glob expansion with relative path 251s > setwd(path) 251s > add(repo, "./glob_dir/*md") 251s > status_exp <- structure(list(staged = list(new = "foo-1", 251s + new = "foo_dir/foo-2", 251s + new = "glob_dir/a.txt", 251s + new = "glob_dir/b.txt", 251s + new = "glob_dir/c.txt", 251s + new = "glob_dir/d.md"), 251s + unstaged = empty_named_list(), 251s + untracked = list(untracked = "foo-2")), 251s + class = "git_status") 251s > status_obs <- status(repo) 251s > str(status_exp) 251s List of 3 251s $ staged :List of 6 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s ..$ new: chr "glob_dir/d.md" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > str(status_obs) 251s List of 3 251s $ staged :List of 6 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s ..$ new: chr "glob_dir/d.md" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > stopifnot(identical(status_obs, status_exp)) 251s > 251s > ## Test to add file in root of workdir when the file also exists in 251s > ## current workdir. 251s > setwd(tempdir()) 251s > writeLines("e", file.path(path, "e.txt")) 251s > writeLines("e", file.path(tempdir(), "e.txt")) 251s > add(repo, "e.txt") 251s > status_exp <- structure(list(staged = list(new = "e.txt", 251s + new = "foo-1", 251s + new = "foo_dir/foo-2", 251s + new = "glob_dir/a.txt", 251s + new = "glob_dir/b.txt", 251s + new = "glob_dir/c.txt", 251s + new = "glob_dir/d.md"), 251s + unstaged = empty_named_list(), 251s + untracked = list(untracked = "foo-2")), 251s + class = "git_status") 251s > status_obs <- status(repo) 251s > str(status_exp) 251s List of 3 251s $ staged :List of 7 251s ..$ new: chr "e.txt" 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s ..$ new: chr "glob_dir/d.md" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > str(status_obs) 251s List of 3 251s $ staged :List of 7 251s ..$ new: chr "e.txt" 251s ..$ new: chr "foo-1" 251s ..$ new: chr "foo_dir/foo-2" 251s ..$ new: chr "glob_dir/a.txt" 251s ..$ new: chr "glob_dir/b.txt" 251s ..$ new: chr "glob_dir/c.txt" 251s ..$ new: chr "glob_dir/d.md" 251s $ unstaged : Named list() 251s $ untracked:List of 1 251s ..$ untracked: chr "foo-2" 251s - attr(*, "class")= chr "git_status" 251s > stopifnot(identical(status_obs, status_exp)) 251s > 251s > ## Cleanup 251s > unlink(path, recursive = TRUE) 251s > 251s BEGIN TEST pull.R 251s 251s R version 4.4.3 (2025-02-28) -- "Trophy Case" 251s Copyright (C) 2025 The R Foundation for Statistical Computing 251s Platform: s390x-ibm-linux-gnu 251s 251s R is free software and comes with ABSOLUTELY NO WARRANTY. 251s You are welcome to redistribute it under certain conditions. 251s Type 'license()' or 'licence()' for distribution details. 251s 251s R is a collaborative project with many contributors. 251s Type 'contributors()' for more information and 251s 'citation()' on how to cite R or R packages in publications. 251s 251s Type 'demo()' for some demos, 'help()' for on-line help, or 251s 'help.start()' for an HTML browser interface to help. 251s Type 'q()' to quit R. 251s 251s > ## git2r, R bindings to the libgit2 library. 251s > ## Copyright (C) 2013-2023 The git2r contributors 251s > ## 251s > ## This program is free software; you can redistribute it and/or modify 251s > ## it under the terms of the GNU General Public License, version 2, 251s > ## as published by the Free Software Foundation. 251s > ## 251s > ## git2r is distributed in the hope that it will be useful, 251s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 251s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 251s > ## GNU General Public License for more details. 251s > ## 251s > ## You should have received a copy of the GNU General Public License along 251s > ## with this program; if not, write to the Free Software Foundation, Inc., 251s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 251s > 251s > library(git2r) 251s > 251s > ## For debugging 251s > sessionInfo() 251s R version 4.4.3 (2025-02-28) 251s Platform: s390x-ibm-linux-gnu 251s Running under: Ubuntu Plucky Puffin (development branch) 251s 251s Matrix products: default 251s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 251s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 251s 251s locale: 251s [1] C 251s 251s time zone: Etc/UTC 251s tzcode source: system (glibc) 251s 251s attached base packages: 251s [1] stats graphics grDevices utils datasets methods base 251s 251s other attached packages: 251s [1] git2r_0.35.0 251s 251s loaded via a namespace (and not attached): 251s [1] compiler_4.4.3 251s > libgit2_version() 251s $major 251s [1] 1 251s 251s $minor 251s [1] 9 251s 251s $rev 251s [1] 0 251s 251s > libgit2_features() 251s $threads 251s [1] TRUE 251s 251s $https 251s [1] TRUE 251s 251s $ssh 251s [1] TRUE 251s 251s > 251s > 251s > ## Create directories for repositories in tempdir 251s > path_bare <- tempfile(pattern = "git2r-") 251s > path_repo_1 <- tempfile(pattern = "git2r-") 251s > path_repo_2 <- tempfile(pattern = "git2r-") 251s > 251s > dir.create(path_bare) 251s > dir.create(path_repo_1) 251s > dir.create(path_repo_2) 251s > 251s > ## Create bare repository 251s > bare_repo <- init(path_bare, bare = TRUE) 251s > 251s > ## Clone to repo 1 251s > repo_1 <- clone(path_bare, path_repo_1) 251s cloning into '/tmp/RtmpGBMhsj/git2r-a697f5d2d90'... 251s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 251s > 251s > ## Add changes to repo 1 and push to bare 251s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 251s + con = file.path(path_repo_1, "test-1.txt")) 251s > add(repo_1, "test-1.txt") 251s > commit_1 <- commit(repo_1, "First commit message") 251s > branch_name <- branches(repo_1)[[1]]$name 251s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 251s > 251s > ## Clone to repo 2 251s > repo_2 <- clone(path_bare, path_repo_2) 251s cloning into '/tmp/RtmpGBMhsj/git2r-a692fef5f26'... 251s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 251s > 251s > ## Add more changes to repo 1 and push to bare 251s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 251s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 251s + con = file.path(path_repo_1, "test-1.txt")) 251s > add(repo_1, "test-1.txt") 251s > commit_2 <- commit(repo_1, "Second commit message") 251s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 251s > 251s > ## Pull changes to repo_2 251s > pull(repo_2) 251s [updated] b880a1ce97..2b0e9ce76c refs/remotes/origin/master 251s Merge: Fast-forward 251s > stopifnot(identical(length(commits(repo_2)), 2L)) 251s > 251s > ## Check remote url of repo_2 251s > stopifnot(identical( 251s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 251s + path_bare)) 251s > 251s > ## Unset remote remote tracking branch 251s > branch_set_upstream(repository_head(repo_2), NULL) 251s > stopifnot(is.null(branch_get_upstream(repository_head(repo_2)))) 251s > tools::assertError(pull(repo_2)) 251s > tools::assertError(branch_set_upstream(repository_head(repo_2), NULL)) 251s > 251s > ## Add more changes to repo 1 and push to bare 251s > writeLines( 251s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 251s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 251s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 251s + con = file.path(path_repo_1, "test-1.txt")) 251s > add(repo_1, "test-1.txt") 251s > commit_3 <- commit(repo_1, "Third commit message") 251s > push(repo_1) 251s > 251s > ## Set remote tracking branch 251s > branch_set_upstream(repository_head(repo_2), 251s + paste0("origin/", branch_name)) 251s > stopifnot(identical( 251s + branch_remote_url(branch_get_upstream(repository_head(repo_2))), 251s + path_bare)) 251s > 251s > ## Pull changes to repo_2 251s > pull(repo_2) 251s [updated] 2b0e9ce76c..0494c5169b refs/remotes/origin/master 251s Merge: Fast-forward 251s > stopifnot(identical(length(commits(repo_2)), 3L)) 251s > 251s > ## Check references in repo_1 and repo_2. Must clear the repo item 251s > ## since the repositories have different paths. 251s > stopifnot(identical(length(references(repo_1)), 2L)) 251s > 251s > ref_1 <- references(repo_1) 251s > lapply(seq_len(length(ref_1)), function(i) { 251s + ref_1[[i]]$repo <<- NULL 251s + }) 251s [[1]] 251s NULL 251s 251s [[2]] 251s NULL 251s 251s > 251s > ref_2 <- references(repo_2) 251s > lapply(seq_len(length(ref_2)), function(i) { 251s + ref_2[[i]]$repo <<- NULL 251s + }) 251s [[1]] 251s NULL 251s 251s [[2]] 251s NULL 251s 251s [[3]] 251s NULL 251s 251s > 251s > name <- paste0("refs/heads/", branch_name) 251s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 251s > 251s > name <- paste0("refs/remotes/", branch_name) 251s > stopifnot(identical(ref_1[[name]], ref_2[[name]])) 251s > 251s > ref_1 <- references(repo_1)[[paste0("refs/heads/", branch_name)]] 251s > stopifnot(identical(ref_1$name, paste0("refs/heads/", branch_name))) 251s > stopifnot(identical(ref_1$type, 1L)) 251s > stopifnot(identical(sha(ref_1), sha(commit_3))) 251s > stopifnot(identical(ref_1$target, NA_character_)) 251s > stopifnot(identical(ref_1$shorthand, branch_name)) 251s > 251s > ref_2 <- references(repo_1)[[paste0("refs/remotes/origin/", branch_name)]] 251s > stopifnot(identical(ref_2$name, paste0("refs/remotes/origin/", branch_name))) 251s > stopifnot(identical(ref_2$type, 1L)) 251s > stopifnot(identical(sha(ref_2), sha(commit_3))) 251s > stopifnot(identical(ref_2$target, NA_character_)) 251s > stopifnot(identical(ref_2$shorthand, paste0("origin/", branch_name))) 251s > 251s > ## Check references with missing repo argument 251s > wd <- setwd(path_repo_1) 251s > stopifnot(identical(length(references()), 2L)) 251s > if (!is.null(wd)) 251s + setwd(wd) 251s > 251s > ## Cleanup 251s > unlink(path_bare, recursive = TRUE) 251s > unlink(path_repo_1, recursive = TRUE) 251s > unlink(path_repo_2, recursive = TRUE) 251s > 251s BEGIN TEST push-force.R 251s 251s R version 4.4.3 (2025-02-28) -- "Trophy Case" 251s Copyright (C) 2025 The R Foundation for Statistical Computing 251s Platform: s390x-ibm-linux-gnu 251s 251s R is free software and comes with ABSOLUTELY NO WARRANTY. 251s You are welcome to redistribute it under certain conditions. 251s Type 'license()' or 'licence()' for distribution details. 251s 251s R is a collaborative project with many contributors. 251s Type 'contributors()' for more information and 251s 'citation()' on how to cite R or R packages in publications. 251s 251s Type 'demo()' for some demos, 'help()' for on-line help, or 251s 'help.start()' for an HTML browser interface to help. 251s Type 'q()' to quit R. 251s 251s > ## git2r, R bindings to the libgit2 library. 251s > ## Copyright (C) 2013-2023 The git2r contributors 251s > ## 251s > ## This program is free software; you can redistribute it and/or modify 251s > ## it under the terms of the GNU General Public License, version 2, 251s > ## as published by the Free Software Foundation. 251s > ## 251s > ## git2r is distributed in the hope that it will be useful, 251s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 251s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 251s > ## GNU General Public License for more details. 251s > ## 251s > ## You should have received a copy of the GNU General Public License along 251s > ## with this program; if not, write to the Free Software Foundation, Inc., 251s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 251s > 251s > library(git2r) 251s > 251s > ## For debugging 251s > sessionInfo() 252s R version 4.4.3 (2025-02-28) 252s Platform: s390x-ibm-linux-gnu 252s Running under: Ubuntu Plucky Puffin (development branch) 252s 252s Matrix products: default 252s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 252s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 252s 252s locale: 252s [1] C 252s 252s time zone: Etc/UTC 252s tzcode source: system (glibc) 252s 252s attached base packages: 252s [1] stats graphics grDevices utils datasets methods base 252s 252s other attached packages: 252s [1] git2r_0.35.0 252s 252s loaded via a namespace (and not attached): 252s [1] compiler_4.4.3 252s > libgit2_version() 252s $major 252s [1] 1 252s 252s $minor 252s [1] 9 252s 252s $rev 252s [1] 0 252s 252s > libgit2_features() 252s $threads 252s [1] TRUE 252s 252s $https 252s [1] TRUE 252s 252s $ssh 252s [1] TRUE 252s 252s > 252s > 252s > ## Create directories for repositories in tempdir 252s > path_bare <- tempfile(pattern = "git2r-") 252s > path_repo_1 <- tempfile(pattern = "git2r-") 252s > path_repo_2 <- tempfile(pattern = "git2r-") 252s > 252s > dir.create(path_bare) 252s > dir.create(path_repo_1) 252s > dir.create(path_repo_2) 252s > 252s > ## Create bare repository 252s > bare_repo <- init(path_bare, bare = TRUE) 252s > 252s > ## Clone to repo 1 252s > repo_1 <- clone(path_bare, path_repo_1) 252s cloning into '/tmp/Rtmpxt7rh1/git2r-a7799234e'... 252s > config(repo_1, user.name = "Alice", user.email = "alice@example.org") 252s > 252s > ## Add changes to repo 1 and push to bare 252s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 252s + con = file.path(path_repo_1, "test-1.txt")) 252s > add(repo_1, "test-1.txt") 252s > commit_1 <- commit(repo_1, "First commit message") 252s > branch_name <- branches(repo_1)[[1]]$name 252s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 252s > 252s > ## Clone to repo 2 252s > repo_2 <- clone(path_bare, path_repo_2) 252s cloning into '/tmp/Rtmpxt7rh1/git2r-a7711b0b5f5'... 252s > config(repo_2, user.name = "Bob", user.email = "bob@example.org") 252s > 252s > ## Add more changes to repo 1 and push to bare 252s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 252s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 252s + con = file.path(path_repo_1, "test-1.txt")) 252s > add(repo_1, "test-1.txt") 252s > commit_2 <- commit(repo_1, "Second commit message") 252s > push(repo_1, "origin", paste0("refs/heads/", branch_name)) 252s > 252s > ## Add changes to repo 2 and push to bare 252s > writeLines( 252s + c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 252s + "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad", 252s + "minim veniam, quis nostrud exercitation ullamco laboris nisi ut"), 252s + con = file.path(path_repo_2, "test-1.txt")) 252s > add(repo_2, "test-1.txt") 252s > commit_3 <- commit(repo_2, "Third commit message") 252s > 252s > ## We are behind, so this should fail 252s > tools::assertError(push(repo_2)) 252s > 252s > ## Push with force = TRUE 252s > push(repo_2, force = TRUE) 252s > 252s > ## Check commits 252s > stopifnot(identical(length(commits(bare_repo)), 2L)) 252s > stopifnot(identical(sha(commits(repo_2)[[1]]), sha(commits(bare_repo)[[1]]))) 252s > stopifnot(identical(sha(commits(repo_2)[[2]]), sha(commits(bare_repo)[[2]]))) 252s > 252s > ## Cleanup 252s > unlink(path_bare, recursive = TRUE) 252s > unlink(path_repo_1, recursive = TRUE) 252s > unlink(path_repo_2, recursive = TRUE) 252s > 252s BEGIN TEST push.R 252s 252s R version 4.4.3 (2025-02-28) -- "Trophy Case" 252s Copyright (C) 2025 The R Foundation for Statistical Computing 252s Platform: s390x-ibm-linux-gnu 252s 252s R is free software and comes with ABSOLUTELY NO WARRANTY. 252s You are welcome to redistribute it under certain conditions. 252s Type 'license()' or 'licence()' for distribution details. 252s 252s R is a collaborative project with many contributors. 252s Type 'contributors()' for more information and 252s 'citation()' on how to cite R or R packages in publications. 252s 252s Type 'demo()' for some demos, 'help()' for on-line help, or 252s 'help.start()' for an HTML browser interface to help. 252s Type 'q()' to quit R. 252s 252s > ## git2r, R bindings to the libgit2 library. 252s > ## Copyright (C) 2013-2023 The git2r contributors 252s > ## 252s > ## This program is free software; you can redistribute it and/or modify 252s > ## it under the terms of the GNU General Public License, version 2, 252s > ## as published by the Free Software Foundation. 252s > ## 252s > ## git2r is distributed in the hope that it will be useful, 252s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 252s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 252s > ## GNU General Public License for more details. 252s > ## 252s > ## You should have received a copy of the GNU General Public License along 252s > ## with this program; if not, write to the Free Software Foundation, Inc., 252s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 252s > 252s > library(git2r) 252s > 252s > ## For debugging 252s > sessionInfo() 252s R version 4.4.3 (2025-02-28) 252s Platform: s390x-ibm-linux-gnu 252s Running under: Ubuntu Plucky Puffin (development branch) 252s 252s Matrix products: default 252s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 252s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 252s 252s locale: 252s [1] C 252s 252s time zone: Etc/UTC 252s tzcode source: system (glibc) 252s 252s attached base packages: 252s [1] stats graphics grDevices utils datasets methods base 252s 252s other attached packages: 252s [1] git2r_0.35.0 252s 252s loaded via a namespace (and not attached): 252s [1] compiler_4.4.3 252s > libgit2_version() 252s $major 252s [1] 1 252s 252s $minor 252s [1] 9 252s 252s $rev 252s [1] 0 252s 252s > libgit2_features() 252s $threads 252s [1] TRUE 252s 252s $https 252s [1] TRUE 252s 252s $ssh 252s [1] TRUE 252s 252s > 252s > 252s > ## Create 2 directories in tempdir 252s > path_bare <- tempfile(pattern = "git2r-") 252s > path_repo <- tempfile(pattern = "git2r-") 252s > 252s > dir.create(path_bare) 252s > dir.create(path_repo) 252s > 252s > ## Create repositories 252s > bare_repo <- init(path_bare, bare = TRUE) 252s > repo <- clone(path_bare, path_repo) 252s cloning into '/tmp/RtmpB52q0y/git2r-a831264c72c'... 252s > 252s > ## Check the repositores 252s > stopifnot(identical(is_bare(bare_repo), TRUE)) 252s > stopifnot(identical(is_bare(repo), FALSE)) 252s > 252s > ## Config repositories 252s > config(repo, user.name = "Alice", user.email = "alice@example.org") 252s > 252s > ## Add changes to repo 252s > writeLines("Hello world", con = file.path(path_repo, "test.txt")) 252s > add(repo, "test.txt") 252s > commit_1 <- commit(repo, "Commit message") 252s > branch_name <- branches(repo)[[1]]$name 252s > 252s > ## Check commit 252s > stopifnot(identical(commit_1$author$name, "Alice")) 252s > stopifnot(identical(commit_1$author$email, "alice@example.org")) 252s > stopifnot(identical(length(commits(repo)), 1L)) 252s > stopifnot(identical(commits(repo)[[1]]$author$name, "Alice")) 252s > stopifnot(identical(commits(repo)[[1]]$author$email, "alice@example.org")) 252s > 252s > ## Check push arguments 252s > tools::assertError(push(repo, character(0), paste0("refs/heads/", branch_name))) 252s > tools::assertError(push(repo, NA_character_, paste0("refs/heads/", branch_name))) 252s > tools::assertError(push(repo, c("origin", "origin"), paste0("refs/heads/", branch_name))) 252s > tools::assertError(push(repo, "origin")) 252s > tools::assertError(push(repo, name = "origin")) 252s > push(repo, "origin", character(0)) 252s > push(repo, "origin", NA_character_) 252s > push(repo, "origin", c(NA_character_, NA_character_)) 252s > stopifnot(identical(reflog(repo, paste0("refs/remotes/origin/", branch_name)), 252s + structure(list(), class = "git_reflog"))) 252s > 252s > ## No tracking branch assigned to master 252s > tools::assertError(push(branches(repo)[[1]])) 252s > 252s > ## Push changes from repo to origin 252s > push(repo, "origin", paste0("refs/heads/", branch_name)) 252s > r <- reflog(repo, paste0("refs/remotes/origin/", branch_name)) 252s > stopifnot(identical(length(r), 1L)) 252s > r <- r[[1]] 252s > stopifnot(identical(sha(r), sha(commit_1))) 252s > stopifnot(identical(r$message, "update by push")) 252s > stopifnot(identical(r$index, 0L)) 252s > stopifnot(identical(r$committer$name, "Alice")) 252s > stopifnot(identical(r$committer$email, "alice@example.org")) 252s > stopifnot(identical(r$refname, paste0("refs/remotes/origin/", branch_name))) 252s > stopifnot(identical(r$repo$path, repo$path)) 252s > push(branches(repo)[[1]]) 252s > 252s > ## Check result in bare repository 252s > stopifnot(identical(length(commits(bare_repo)), 1L)) 252s > bare_commit_1 <- commits(bare_repo)[[1]] 252s > stopifnot(identical(sha(commit_1), sha(bare_commit_1))) 252s > stopifnot(identical(commit_1$author, bare_commit_1$author)) 252s > stopifnot(identical(commit_1$committer, bare_commit_1$committer)) 252s > stopifnot(identical(commit_1$summary, bare_commit_1$summary)) 252s > stopifnot(identical(commit_1$message, bare_commit_1$message)) 252s > stopifnot(!identical(commit_1$repo, bare_commit_1$repo)) 252s > 252s > ## Add changes to repo and push head 252s > writeLines(c("Hello world", "HELLO WORLD"), 252s + con = file.path(path_repo, "test.txt")) 252s > add(repo, "test.txt") 252s > commit_2 <- commit(repo, "Commit message 2") 252s > push(repo) 252s > bare_commit_2 <- lookup(bare_repo, sha(commit_2)) 252s > stopifnot(identical(sha(commit_2), sha(bare_commit_2))) 252s > stopifnot(identical(commit_2$author, bare_commit_2$author)) 252s > stopifnot(identical(commit_2$committer, bare_commit_2$committer)) 252s > stopifnot(identical(commit_2$summary, bare_commit_2$summary)) 252s > stopifnot(identical(commit_2$message, bare_commit_2$message)) 252s > stopifnot(!identical(commit_2$repo, bare_commit_2$repo)) 252s > 252s > ## Check 'set_upstream' 252s > branch_set_upstream(repository_head(repo), NULL) 252s > push(repo, "origin", paste0("refs/heads/", branch_name)) 252s > stopifnot(is.null(branch_get_upstream(repository_head(repo)))) 252s > push(repo, "origin", paste0("refs/heads/", branch_name), set_upstream = TRUE) 252s > stopifnot(!is.null(branch_get_upstream(repository_head(repo)))) 252s > 252s > ## Cleanup 252s > unlink(path_bare, recursive = TRUE) 252s > unlink(path_repo, recursive = TRUE) 252s > 252s BEGIN TEST reference.R 252s 252s R version 4.4.3 (2025-02-28) -- "Trophy Case" 252s Copyright (C) 2025 The R Foundation for Statistical Computing 252s Platform: s390x-ibm-linux-gnu 252s 252s R is free software and comes with ABSOLUTELY NO WARRANTY. 252s You are welcome to redistribute it under certain conditions. 252s Type 'license()' or 'licence()' for distribution details. 252s 252s R is a collaborative project with many contributors. 252s Type 'contributors()' for more information and 252s 'citation()' on how to cite R or R packages in publications. 252s 252s Type 'demo()' for some demos, 'help()' for on-line help, or 252s 'help.start()' for an HTML browser interface to help. 252s Type 'q()' to quit R. 252s 252s > ## git2r, R bindings to the libgit2 library. 252s > ## Copyright (C) 2013-2023 The git2r contributors 252s > ## 252s > ## This program is free software; you can redistribute it and/or modify 252s > ## it under the terms of the GNU General Public License, version 2, 252s > ## as published by the Free Software Foundation. 252s > ## 252s > ## git2r is distributed in the hope that it will be useful, 252s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 252s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 252s > ## GNU General Public License for more details. 252s > ## 252s > ## You should have received a copy of the GNU General Public License along 252s > ## with this program; if not, write to the Free Software Foundation, Inc., 252s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 252s > 252s > library(git2r) 252s > 252s > ## For debugging 252s > sessionInfo() 252s R version 4.4.3 (2025-02-28) 252s Platform: s390x-ibm-linux-gnu 252s Running under: Ubuntu Plucky Puffin (development branch) 252s 252s Matrix products: default 252s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 252s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 252s 252s locale: 252s [1] C 252s 252s time zone: Etc/UTC 252s tzcode source: system (glibc) 252s 252s attached base packages: 252s [1] stats graphics grDevices utils datasets methods base 252s 252s other attached packages: 252s [1] git2r_0.35.0 252s 252s loaded via a namespace (and not attached): 252s [1] compiler_4.4.3 252s > libgit2_version() 252s $major 252s [1] 1 252s 252s $minor 252s [1] 9 252s 252s $rev 252s [1] 0 252s 252s > libgit2_features() 252s $threads 252s [1] TRUE 252s 252s $https 252s [1] TRUE 252s 252s $ssh 252s [1] TRUE 252s 252s > 252s > 252s > ## Create a directory in tempdir 252s > path <- tempfile(pattern = "git2r-") 252s > dir.create(path) 252s > 252s > ## Initialize a repository 252s > repo <- init(path, branch = "main") 252s > config(repo, user.name = "Alice", user.email = "alice@example.org") 252s > 252s > ## Create a file 252s > writeLines("Hello world!", file.path(path, "test.txt")) 252s > 252s > ## add and commit 252s > add(repo, "test.txt") 252s > commit(repo, "Commit message") 252s [6dbe2b5] 2025-03-15: Commit message 252s > 252s > ## Check dwim of reference shorthand 252s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "")$name, 252s + "refs/heads/main")) 252s > stopifnot(identical(.Call(git2r:::git2r_reference_dwim, repo, "main")$name, 252s + "refs/heads/main")) 252s > stopifnot(identical( 252s + .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main")$name, 252s + "refs/heads/main")) 252s > 252s > ## print reference 252s > r <- .Call(git2r:::git2r_reference_dwim, repo, "refs/heads/main") 252s > stopifnot(identical(print(r), r)) 252s [6dbe2b] main 252s > 252s > ## Cleanup 252s > unlink(path, recursive = TRUE) 252s > 252s BEGIN TEST reflog.R 252s 252s R version 4.4.3 (2025-02-28) -- "Trophy Case" 252s Copyright (C) 2025 The R Foundation for Statistical Computing 252s Platform: s390x-ibm-linux-gnu 252s 252s R is free software and comes with ABSOLUTELY NO WARRANTY. 252s You are welcome to redistribute it under certain conditions. 252s Type 'license()' or 'licence()' for distribution details. 252s 252s R is a collaborative project with many contributors. 252s Type 'contributors()' for more information and 252s 'citation()' on how to cite R or R packages in publications. 252s 252s Type 'demo()' for some demos, 'help()' for on-line help, or 252s 'help.start()' for an HTML browser interface to help. 252s Type 'q()' to quit R. 252s 252s > ## git2r, R bindings to the libgit2 library. 252s > ## Copyright (C) 2013-2023 The git2r contributors 252s > ## 252s > ## This program is free software; you can redistribute it and/or modify 252s > ## it under the terms of the GNU General Public License, version 2, 252s > ## as published by the Free Software Foundation. 252s > ## 252s > ## git2r is distributed in the hope that it will be useful, 252s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 252s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 252s > ## GNU General Public License for more details. 252s > ## 252s > ## You should have received a copy of the GNU General Public License along 252s > ## with this program; if not, write to the Free Software Foundation, Inc., 252s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 252s > 252s > library("git2r") 252s > 252s > ## For debugging 252s > sessionInfo() 252s R version 4.4.3 (2025-02-28) 252s Platform: s390x-ibm-linux-gnu 252s Running under: Ubuntu Plucky Puffin (development branch) 252s 252s Matrix products: default 252s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 252s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 252s 252s locale: 252s [1] C 252s 252s time zone: Etc/UTC 252s tzcode source: system (glibc) 252s 252s attached base packages: 252s [1] stats graphics grDevices utils datasets methods base 252s 252s other attached packages: 252s [1] git2r_0.35.0 252s 252s loaded via a namespace (and not attached): 252s [1] compiler_4.4.3 252s > libgit2_version() 252s $major 252s [1] 1 252s 252s $minor 252s [1] 9 252s 252s $rev 252s [1] 0 252s 252s > libgit2_features() 252s $threads 252s [1] TRUE 252s 252s $https 252s [1] TRUE 252s 252s $ssh 252s [1] TRUE 252s 252s > 252s > 252s > ## Create a directory in tempdir 252s > path <- tempfile(pattern = "git2r-") 252s > dir.create(path) 252s > 252s > ## Initialize a repository 252s > repo <- init(path) 252s > config(repo, user.name = "Alice", user.email = "alice@example.org") 252s > 252s > ## Check that reflog is empty 252s > stopifnot(identical(reflog(repo), structure(list(), class = "git_reflog"))) 252s > 252s > ## Create a file 252s > writeLines("Hello world!", file.path(path, "test.txt")) 252s > 252s > ## add and commit 252s > add(repo, "test.txt") 252s > commit_1 <- commit(repo, "Commit message") 252s > 252s > ## Check that reflog is not empry 252s > stopifnot(identical(length(reflog(repo)), 1L)) 252s > reflog_entry <- reflog(repo)[[1]] 252s > stopifnot(identical(sha(reflog_entry), sha(commit_1))) 252s > stopifnot(identical(reflog_entry$refname, "HEAD")) 252s > stopifnot(identical(reflog_entry$index, 0L)) 252s > stopifnot(identical(reflog_entry$committer$email, "alice@example.org")) 252s > stopifnot(identical(reflog_entry$message, "commit (initial): Commit message")) 252s > 252s > ## Check printing 252s > r <- reflog(repo) 252s > stopifnot(identical(print(r), r)) 252s [6dbe2b5] HEAD@{0}: commit (initial): Commit message 252s > 252s > ## Cleanup 252s > unlink(path, recursive = TRUE) 252s > 252s BEGIN TEST refspec.R 252s 252s R version 4.4.3 (2025-02-28) -- "Trophy Case" 252s Copyright (C) 2025 The R Foundation for Statistical Computing 252s Platform: s390x-ibm-linux-gnu 252s 252s R is free software and comes with ABSOLUTELY NO WARRANTY. 252s You are welcome to redistribute it under certain conditions. 252s Type 'license()' or 'licence()' for distribution details. 252s 252s R is a collaborative project with many contributors. 252s Type 'contributors()' for more information and 252s 'citation()' on how to cite R or R packages in publications. 252s 252s Type 'demo()' for some demos, 'help()' for on-line help, or 252s 'help.start()' for an HTML browser interface to help. 252s Type 'q()' to quit R. 252s 252s > ## git2r, R bindings to the libgit2 library. 252s > ## Copyright (C) 2013-2023 The git2r contributors 252s > ## 252s > ## This program is free software; you can redistribute it and/or modify 252s > ## it under the terms of the GNU General Public License, version 2, 252s > ## as published by the Free Software Foundation. 252s > ## 252s > ## git2r is distributed in the hope that it will be useful, 252s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 252s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 252s > ## GNU General Public License for more details. 252s > ## 252s > ## You should have received a copy of the GNU General Public License along 252s > ## with this program; if not, write to the Free Software Foundation, Inc., 252s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 252s > 252s > library("git2r") 252s > 252s > ## For debugging 252s > sessionInfo() 252s R version 4.4.3 (2025-02-28) 252s Platform: s390x-ibm-linux-gnu 252s Running under: Ubuntu Plucky Puffin (development branch) 252s 252s Matrix products: default 252s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 252s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 252s 252s locale: 252s [1] C 252s 252s time zone: Etc/UTC 252s tzcode source: system (glibc) 252s 252s attached base packages: 252s [1] stats graphics grDevices utils datasets methods base 252s 252s other attached packages: 252s [1] git2r_0.35.0 252s 252s loaded via a namespace (and not attached): 252s [1] compiler_4.4.3 252s > libgit2_version() 252s $major 252s [1] 1 252s 252s $minor 252s [1] 9 252s 252s $rev 252s [1] 0 252s 252s > libgit2_features() 252s $threads 252s [1] TRUE 252s 252s $https 252s [1] TRUE 252s 252s $ssh 252s [1] TRUE 252s 252s > 252s > 252s > ## Create directories for repositories in tempdir 252s > path_bare <- tempfile(pattern = "git2r-") 252s > path_repo <- tempfile(pattern = "git2r-") 252s > 252s > dir.create(path_bare) 252s > dir.create(path_repo) 252s > 252s > ## Create bare repository 252s > bare_repo <- init(path_bare, bare = TRUE) 252s > 252s > ## Clone to repo 252s > repo <- clone(path_bare, path_repo) 252s cloning into '/tmp/RtmpuNWGF9/git2r-aa752e589c9'... 252s > config(repo, user.name = "Alice", user.email = "alice@example.org") 252s > 252s > ## Add changes to repo 252s > writeLines("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 252s + con = file.path(path_repo, "test.txt")) 252s > add(repo, "test.txt") 252s > commit_1 <- commit(repo, "First commit message") 252s > 252s > ## Add more changes to repo 252s > writeLines(c("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do", 252s + "eiusmod tempor incididunt ut labore et dolore magna aliqua."), 252s + con = file.path(path_repo, "test.txt")) 252s > add(repo, "test.txt") 252s > commit_2 <- commit(repo, "Second commit message") 252s > 252s > ## Check remote 252s > stopifnot(identical( 252s + git2r:::get_refspec(repo, spec = "master")$remote, 252s + "origin")) 252s > 252s > ## Detach 252s > checkout(commit_1) 252s > tools::assertError(git2r:::get_refspec(repo)) 252s > 252s > ## Cleanup 252s > unlink(path_bare, recursive = TRUE) 252s > unlink(path_repo, recursive = TRUE) 252s > 252s BEGIN TEST remotes.R 252s 252s R version 4.4.3 (2025-02-28) -- "Trophy Case" 252s Copyright (C) 2025 The R Foundation for Statistical Computing 252s Platform: s390x-ibm-linux-gnu 252s 252s R is free software and comes with ABSOLUTELY NO WARRANTY. 252s You are welcome to redistribute it under certain conditions. 252s Type 'license()' or 'licence()' for distribution details. 252s 252s R is a collaborative project with many contributors. 252s Type 'contributors()' for more information and 252s 'citation()' on how to cite R or R packages in publications. 252s 252s Type 'demo()' for some demos, 'help()' for on-line help, or 252s 'help.start()' for an HTML browser interface to help. 252s Type 'q()' to quit R. 252s 252s > ## git2r, R bindings to the libgit2 library. 252s > ## Copyright (C) 2013-2023 The git2r contributors 252s > ## 252s > ## This program is free software; you can redistribute it and/or modify 252s > ## it under the terms of the GNU General Public License, version 2, 252s > ## as published by the Free Software Foundation. 252s > ## 252s > ## git2r is distributed in the hope that it will be useful, 252s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 252s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 252s > ## GNU General Public License for more details. 252s > ## 252s > ## You should have received a copy of the GNU General Public License along 252s > ## with this program; if not, write to the Free Software Foundation, Inc., 252s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 252s > 252s > library("git2r") 253s > 253s > ## For debugging 253s > sessionInfo() 253s R version 4.4.3 (2025-02-28) 253s Platform: s390x-ibm-linux-gnu 253s Running under: Ubuntu Plucky Puffin (development branch) 253s 253s Matrix products: default 253s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 253s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 253s 253s locale: 253s [1] C 253s 253s time zone: Etc/UTC 253s tzcode source: system (glibc) 253s 253s attached base packages: 253s [1] stats graphics grDevices utils datasets methods base 253s 253s other attached packages: 253s [1] git2r_0.35.0 253s 253s loaded via a namespace (and not attached): 253s [1] compiler_4.4.3 253s > libgit2_version() 253s $major 253s [1] 1 253s 253s $minor 253s [1] 9 253s 253s $rev 253s [1] 0 253s 253s > libgit2_features() 253s $threads 253s [1] TRUE 253s 253s $https 253s [1] TRUE 253s 253s $ssh 253s [1] TRUE 253s 253s > 253s > 253s > ## Create a directory in tempdir 253s > path <- tempfile(pattern = "git2r-") 253s > dir.create(path) 253s > 253s > ## Initialize a repository 253s > repo <- init(path) 253s > config(repo, user.name = "Alice", user.email = "alice@example.org") 253s > 253s > ## Create a file 253s > writeLines("Hello world!", file.path(path, "test.txt")) 253s > 253s > ## Add and commit 253s > add(repo, "test.txt") 253s > commit_1 <- commit(repo, "Commit message") 253s > 253s > ## Add a remote 253s > remote_add(repo, "playground", 253s + "https://github.com/gaborcsardi/playground") 253s > 253s > stopifnot(identical(remotes(repo), "playground")) 253s > stopifnot(identical(remote_url(repo, "playground"), 253s + "https://github.com/gaborcsardi/playground")) 253s > stopifnot(identical(remote_url(repo), 253s + "https://github.com/gaborcsardi/playground")) 253s > 253s > ## Rename a remote 253s > remote_rename(repo, "playground", "foobar") 253s > 253s > stopifnot(identical(remotes(repo), "foobar")) 253s > stopifnot(identical(remote_url(repo, "foobar"), 253s + "https://github.com/gaborcsardi/playground")) 253s > 253s > ## Set remote url 253s > remote_set_url(repo, "foobar", "https://github.com/stewid/playground") 253s > stopifnot(identical(remote_url(repo, "foobar"), 253s + "https://github.com/stewid/playground")) 253s > 253s > ## Remove a remote 253s > remote_remove(repo, "foobar") 253s > 253s > stopifnot(identical(remotes(repo), character(0))) 253s > 253s > if (identical(Sys.getenv("NOT_CRAN"), "true")) { 253s + if (isTRUE(libgit2_features()$https)) { 253s + refs <- remote_ls("https://github.com/ropensci/git2r") 253s + stopifnot(length(refs) > 0) 253s + stopifnot(names(refs) > 0) 253s + stopifnot(any(names(refs) == "HEAD")) 253s + } 253s + } 253s > 253s > # an invalid URL should throw an error 253s > tools::assertError(remote_ls("bad")) 253s > 253s > ## Cleanup 253s > unlink(path, recursive = TRUE) 253s > 253s BEGIN TEST remove.R 253s 253s R version 4.4.3 (2025-02-28) -- "Trophy Case" 253s Copyright (C) 2025 The R Foundation for Statistical Computing 253s Platform: s390x-ibm-linux-gnu 253s 253s R is free software and comes with ABSOLUTELY NO WARRANTY. 253s You are welcome to redistribute it under certain conditions. 253s Type 'license()' or 'licence()' for distribution details. 253s 253s R is a collaborative project with many contributors. 253s Type 'contributors()' for more information and 253s 'citation()' on how to cite R or R packages in publications. 253s 253s Type 'demo()' for some demos, 'help()' for on-line help, or 253s 'help.start()' for an HTML browser interface to help. 253s Type 'q()' to quit R. 253s 253s > ## git2r, R bindings to the libgit2 library. 253s > ## Copyright (C) 2013-2023 The git2r contributors 253s > ## 253s > ## This program is free software; you can redistribute it and/or modify 253s > ## it under the terms of the GNU General Public License, version 2, 253s > ## as published by the Free Software Foundation. 253s > ## 253s > ## git2r is distributed in the hope that it will be useful, 253s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 253s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 253s > ## GNU General Public License for more details. 253s > ## 253s > ## You should have received a copy of the GNU General Public License along 253s > ## with this program; if not, write to the Free Software Foundation, Inc., 253s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 253s > 253s > library("git2r") 253s > 253s > ## For debugging 253s > sessionInfo() 253s R version 4.4.3 (2025-02-28) 253s Platform: s390x-ibm-linux-gnu 253s Running under: Ubuntu Plucky Puffin (development branch) 253s 253s Matrix products: default 253s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 253s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 253s 253s locale: 253s [1] C 253s 253s time zone: Etc/UTC 253s tzcode source: system (glibc) 253s 253s attached base packages: 253s [1] stats graphics grDevices utils datasets methods base 253s 253s other attached packages: 253s [1] git2r_0.35.0 253s 253s loaded via a namespace (and not attached): 253s [1] compiler_4.4.3 253s > libgit2_version() 253s $major 253s [1] 1 253s 253s $minor 253s [1] 9 253s 253s $rev 253s [1] 0 253s 253s > libgit2_features() 253s $threads 253s [1] TRUE 253s 253s $https 253s [1] TRUE 253s 253s $ssh 253s [1] TRUE 253s 253s > 253s > 253s > ## Create a directory in tempdir 253s > path <- tempfile(pattern = "git2r-") 253s > dir.create(path) 253s > 253s > ## Initialize a repository 253s > repo <- init(path) 253s > config(repo, user.name = "Alice", user.email = "alice@example.org") 253s > 253s > ## Add files 253s > invisible(lapply(file.path(path, letters[1:4]), writeLines, text = "")) 253s > add(repo, letters) 253s > commit(repo, "init") 253s [e5b63bd] 2025-03-15: init 253s > 253s > ## Remove one file 253s > rm_file(repo, letters[1]) 253s > commit(repo, "remove") 253s [2a17c41] 2025-03-15: remove 253s > 253s > ## Remove two files. Don't raise warnings 253s > withCallingHandlers(rm_file(repo, letters[2:3]), warning = function(w) stop(w)) 253s > 253s > ## Remove one file using the absolute path to the file. 253s > rm_file(repo, file.path(path, letters[4])) 253s > 253s > ## Cleanup 253s > unlink(path, recursive = TRUE) 253s > 253s BEGIN TEST repository.R 253s 253s R version 4.4.3 (2025-02-28) -- "Trophy Case" 253s Copyright (C) 2025 The R Foundation for Statistical Computing 253s Platform: s390x-ibm-linux-gnu 253s 253s R is free software and comes with ABSOLUTELY NO WARRANTY. 253s You are welcome to redistribute it under certain conditions. 253s Type 'license()' or 'licence()' for distribution details. 253s 253s R is a collaborative project with many contributors. 253s Type 'contributors()' for more information and 253s 'citation()' on how to cite R or R packages in publications. 253s 253s Type 'demo()' for some demos, 'help()' for on-line help, or 253s 'help.start()' for an HTML browser interface to help. 253s Type 'q()' to quit R. 253s 253s > ## git2r, R bindings to the libgit2 library. 253s > ## Copyright (C) 2013-2023 The git2r contributors 253s > ## 253s > ## This program is free software; you can redistribute it and/or modify 253s > ## it under the terms of the GNU General Public License, version 2, 253s > ## as published by the Free Software Foundation. 253s > ## 253s > ## git2r is distributed in the hope that it will be useful, 253s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 253s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 253s > ## GNU General Public License for more details. 253s > ## 253s > ## You should have received a copy of the GNU General Public License along 253s > ## with this program; if not, write to the Free Software Foundation, Inc., 253s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 253s > 253s > library(git2r) 253s > source("util/check.R") 253s > 253s > ## For debugging 253s > sessionInfo() 253s R version 4.4.3 (2025-02-28) 253s Platform: s390x-ibm-linux-gnu 253s Running under: Ubuntu Plucky Puffin (development branch) 253s 253s Matrix products: default 253s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 253s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 253s 253s locale: 253s [1] C 253s 253s time zone: Etc/UTC 253s tzcode source: system (glibc) 253s 253s attached base packages: 253s [1] stats graphics grDevices utils datasets methods base 253s 253s other attached packages: 253s [1] git2r_0.35.0 253s 253s loaded via a namespace (and not attached): 253s [1] compiler_4.4.3 253s > libgit2_version() 253s $major 253s [1] 1 253s 253s $minor 253s [1] 9 253s 253s $rev 253s [1] 0 253s 253s > libgit2_features() 253s $threads 253s [1] TRUE 253s 253s $https 253s [1] TRUE 253s 253s $ssh 253s [1] TRUE 253s 253s > 253s > 253s > ## Create a directory in tempdir 253s > path <- tempfile(pattern = "git2r-") 253s > dir.create(path) 253s > 253s > ## is_bare: "Invalid repository" 253s > tools::assertError(is_bare(new("git_repository"))) 253s > 253s > ## is_empty: "Invalid repository" 253s > tools::assertError(is_empty(new("git_repository"))) 253s > 253s > ## Check that open an invalid repository fails 253s > tools::assertError(repository(path)) 253s > tools::assertError(repository(path, discover = FALSE)) 253s > 253s > ## Check that it fails to open/init a repository with a path to a 253s > ## file. 253s > writeLines("test", file.path(path, "test.txt")) 253s > tools::assertError(repository(file.path(path, "test.txt"), 253s + discover = FALSE)) 253s > tools::assertError(init(file.path(path, "test.txt"))) 253s > unlink(file.path(path, "test.txt")) 253s > 253s > ## Initialize a repository 253s > repo <- init(path) 253s > stopifnot(identical(print(repo), repo)) 253s Local: /tmp/RtmpkKENC3/git2r-acb156019be 253s Head: nothing commited (yet) 253s > 253s > ## Check the state of the repository 253s > stopifnot(identical(is_bare(repo), FALSE)) 253s > stopifnot(identical(is_empty(repo), TRUE)) 253s > stopifnot(identical(is_shallow(repo), FALSE)) 253s > stopifnot(identical(branches(repo), empty_named_list())) 253s > stopifnot(identical(references(repo), empty_named_list())) 253s > stopifnot(identical(commits(repo), list())) 253s > stopifnot(identical(repository_head(repo), NULL)) 253s > 253s > # check that we can find repository from a path 253s > wd <- sub(paste0("[", .Platform$file.sep, "]$"), "", workdir(repo)) 253s > writeLines("test file", con = file.path(wd, "myfile.txt")) 253s > stopifnot(identical(discover_repository(file.path(wd, "myfile.txt")), 253s + file.path(wd, ".git"))) 253s > stopifnot(identical(discover_repository(file.path(wd, "doesntexist.txt")), 253s + NULL)) 253s > Warning message: 253s In normalizePath(path) : 253s path[1]="/tmp/RtmpkKENC3/git2r-acb156019be/doesntexist.txt": No such file or directory 253s 253s > # Check that we can use ceiling in discover repostiory 253s > dir.create(file.path(wd, "temp")) 253s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 0), NULL)) 253s > stopifnot(identical(discover_repository(file.path(wd, "temp"), 1), 253s + file.path(wd, ".git"))) 253s > tools::assertError(discover_repository(file.path(wd, "temp"), 2)) 253s > 253s > ## Check that lookup with a sha of less than 4 characters or more than 253s > ## 40 characters fail. 253s > tools::assertError(lookup(repo, paste0(rep("a", 3), collapse = ""))) 253s > tools::assertError(lookup(repo, paste0(rep("a", 41), collapse = ""))) 253s > 253s > ## Check in_repository 253s > stopifnot(identical(in_repository(path), TRUE)) 253s > 253s > ## Check: 253s > ## - in_repository method with missing path argument 253s > ## - repository method with missing path argument 253s > ## - workdir method with missing path argument 253s > ## - is_empty method with missing repo argument 253s > ## - is_shallow method with missing repo argument 253s > wd <- setwd(path) 253s > stopifnot(identical(in_repository(), TRUE)) 253s > stopifnot(identical(workdir(repository(path)), workdir(repository()))) 253s > stopifnot(identical(workdir(repository(path)), workdir())) 253s > stopifnot(identical(is_empty(), TRUE)) 253s > stopifnot(identical(is_shallow(), FALSE)) 253s > if (!is.null(wd)) 253s + setwd(wd) 253s > 253s > ## Cleanup 253s > unlink(path, recursive = TRUE) 253s > 253s BEGIN TEST reset.R 253s 253s R version 4.4.3 (2025-02-28) -- "Trophy Case" 253s Copyright (C) 2025 The R Foundation for Statistical Computing 253s Platform: s390x-ibm-linux-gnu 253s 253s R is free software and comes with ABSOLUTELY NO WARRANTY. 253s You are welcome to redistribute it under certain conditions. 253s Type 'license()' or 'licence()' for distribution details. 253s 253s R is a collaborative project with many contributors. 253s Type 'contributors()' for more information and 253s 'citation()' on how to cite R or R packages in publications. 253s 253s Type 'demo()' for some demos, 'help()' for on-line help, or 253s 'help.start()' for an HTML browser interface to help. 253s Type 'q()' to quit R. 253s 253s > ## git2r, R bindings to the libgit2 library. 253s > ## Copyright (C) 2013-2023 The git2r contributors 253s > ## 253s > ## This program is free software; you can redistribute it and/or modify 253s > ## it under the terms of the GNU General Public License, version 2, 253s > ## as published by the Free Software Foundation. 253s > ## 253s > ## git2r is distributed in the hope that it will be useful, 253s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 253s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 253s > ## GNU General Public License for more details. 253s > ## 253s > ## You should have received a copy of the GNU General Public License along 253s > ## with this program; if not, write to the Free Software Foundation, Inc., 253s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 253s > 253s > library(git2r) 253s > source("util/check.R") 253s > 253s > ## For debugging 253s > sessionInfo() 253s R version 4.4.3 (2025-02-28) 253s Platform: s390x-ibm-linux-gnu 253s Running under: Ubuntu Plucky Puffin (development branch) 253s 253s Matrix products: default 253s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 253s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 253s 253s locale: 253s [1] C 253s 253s time zone: Etc/UTC 253s tzcode source: system (glibc) 253s 253s attached base packages: 253s [1] stats graphics grDevices utils datasets methods base 253s 253s other attached packages: 253s [1] git2r_0.35.0 253s 253s loaded via a namespace (and not attached): 253s [1] compiler_4.4.3 253s > libgit2_version() 253s $major 253s [1] 1 253s 253s $minor 253s [1] 9 253s 253s $rev 253s [1] 0 253s 253s > libgit2_features() 253s $threads 253s [1] TRUE 253s 253s $https 253s [1] TRUE 253s 253s $ssh 253s [1] TRUE 253s 253s > 253s > 253s > ## Create a directory in tempdir 253s > path <- tempfile(pattern = "git2r-") 253s > dir.create(path) 253s > 253s > ## Initialize a repository 253s > repo <- init(path) 253s > config(repo, user.name = "Alice", user.email = "alice@example.org") 253s > 253s > ## Create a file 253s > writeLines("Hello world!", file.path(path, "test-1.txt")) 253s > 253s > ## Add and reset an empty repository using a path 253s > add(repo, "test-1.txt") 253s > stopifnot(identical( 253s + status(repo), 253s + structure(list(staged = list(new = "test-1.txt"), 253s + unstaged = empty_named_list(), 253s + untracked = empty_named_list()), 253s + class = "git_status"))) 253s > reset(repo, path = "test-1.txt") 253s > stopifnot(identical( 253s + status(repo), 253s + structure(list(staged = empty_named_list(), 253s + unstaged = empty_named_list(), 253s + untracked = list(untracked = "test-1.txt")), 253s + class = "git_status"))) 253s > 253s > ## Add and reset a non-empty repository using a path 253s > add(repo, "test-1.txt") 253s > commit(repo, "First commit") 253s [5f56e84] 2025-03-15: First commit 253s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 253s > add(repo, "test-1.txt") 253s > stopifnot(identical( 253s + status(repo), 253s + structure(list(staged = list(modified = "test-1.txt"), 253s + unstaged = empty_named_list(), 253s + untracked = empty_named_list()), 253s + class = "git_status"))) 253s > reset(repo, path = "test-1.txt") 253s > stopifnot(identical( 253s + status(repo), 253s + structure(list(staged = empty_named_list(), 253s + unstaged = list(modified = "test-1.txt"), 253s + untracked = empty_named_list()), 253s + class = "git_status"))) 253s > 253s > ## add and commit 253s > add(repo, "test-1.txt") 253s > commit_1 <- commit(repo, "Commit message") 253s > 253s > ## Make one more commit 253s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 253s + file.path(path, "test-1.txt")) 253s > add(repo, "test-1.txt") 253s > commit(repo, "Next commit message") 253s [a5867f9] 2025-03-15: Next commit message 253s > 253s > ## Create one more file 253s > writeLines("Hello world!", file.path(path, "test-2.txt")) 253s > 253s > ## 'soft' reset to first commit 253s > reset(commit_1) 253s > soft_exp <- structure(list(staged = list(modified = "test-1.txt"), 253s + unstaged = empty_named_list(), 253s + untracked = list(untracked = "test-2.txt")), 253s + class = "git_status") 253s > soft_obs <- status(repo) 253s > stopifnot(identical(soft_obs, soft_exp)) 253s > stopifnot(identical(length(commits(repo)), 2L)) 253s > stopifnot(identical(commits(repo)[[1]], commit_1)) 253s > 253s > ## 'mixed' reset to first commit 253s > commit(repo, "Next commit message") 253s [a5867f9] 2025-03-15: Next commit message 253s > reset(commit_1, "mixed") 253s > mixed_exp <- structure(list(staged = empty_named_list(), 253s + unstaged = list(modified = "test-1.txt"), 253s + untracked = list(untracked = "test-2.txt")), 253s + class = "git_status") 253s > mixed_obs <- status(repo) 253s > stopifnot(identical(mixed_obs, mixed_exp)) 253s > stopifnot(identical(length(commits(repo)), 2L)) 253s > stopifnot(identical(commits(repo)[[1]], commit_1)) 253s > 253s > ## 'hard' reset to first commit 253s > add(repo, "test-1.txt") 253s > commit(repo, "Next commit message") 253s [a5867f9] 2025-03-15: Next commit message 253s > reset(commit_1, "hard") 253s > hard_exp <- structure(list(staged = empty_named_list(), 253s + unstaged = empty_named_list(), 253s + untracked = list(untracked = "test-2.txt")), 253s + class = "git_status") 253s > hard_obs <- status(repo) 253s > stopifnot(identical(hard_obs, hard_exp)) 253s > stopifnot(identical(length(commits(repo)), 2L)) 253s > stopifnot(identical(commits(repo)[[1]], commit_1)) 253s > 253s > ## Cleanup 253s > unlink(path, recursive = TRUE) 253s > 253s BEGIN TEST revparse.R 253s 253s R version 4.4.3 (2025-02-28) -- "Trophy Case" 253s Copyright (C) 2025 The R Foundation for Statistical Computing 253s Platform: s390x-ibm-linux-gnu 253s 253s R is free software and comes with ABSOLUTELY NO WARRANTY. 253s You are welcome to redistribute it under certain conditions. 253s Type 'license()' or 'licence()' for distribution details. 253s 253s R is a collaborative project with many contributors. 253s Type 'contributors()' for more information and 253s 'citation()' on how to cite R or R packages in publications. 253s 253s Type 'demo()' for some demos, 'help()' for on-line help, or 253s 'help.start()' for an HTML browser interface to help. 253s Type 'q()' to quit R. 253s 253s > ## git2r, R bindings to the libgit2 library. 253s > ## Copyright (C) 2013-2023 The git2r contributors 253s > ## 253s > ## This program is free software; you can redistribute it and/or modify 253s > ## it under the terms of the GNU General Public License, version 2, 253s > ## as published by the Free Software Foundation. 253s > ## 253s > ## git2r is distributed in the hope that it will be useful, 253s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 253s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 253s > ## GNU General Public License for more details. 253s > ## 253s > ## You should have received a copy of the GNU General Public License along 253s > ## with this program; if not, write to the Free Software Foundation, Inc., 253s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 253s > 253s > library("git2r") 253s > 253s > ## For debugging 253s > sessionInfo() 253s R version 4.4.3 (2025-02-28) 253s Platform: s390x-ibm-linux-gnu 253s Running under: Ubuntu Plucky Puffin (development branch) 253s 253s Matrix products: default 253s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 253s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 253s 253s locale: 253s [1] C 253s 253s time zone: Etc/UTC 253s tzcode source: system (glibc) 253s 253s attached base packages: 253s [1] stats graphics grDevices utils datasets methods base 253s 253s other attached packages: 253s [1] git2r_0.35.0 253s 253s loaded via a namespace (and not attached): 253s [1] compiler_4.4.3 253s > libgit2_version() 253s $major 253s [1] 1 253s 253s $minor 253s [1] 9 253s 253s $rev 253s [1] 0 253s 253s > libgit2_features() 253s $threads 253s [1] TRUE 253s 253s $https 253s [1] TRUE 253s 253s $ssh 253s [1] TRUE 253s 253s > 253s > 253s > ## Create a directory in tempdir 253s > path <- tempfile(pattern = "git2r-") 253s > dir.create(path) 253s > 253s > ## Initialize a repository 253s > repo <- init(path) 253s > config(repo, user.name = "Alice", user.email = "alice@example.org") 253s > 253s > ## Create a file 253s > writeLines("Hello world!", file.path(path, "test.txt")) 253s > 253s > ## Add and commit 253s > add(repo, "test.txt") 253s > commit_1 <- commit(repo, "First commit message") 253s > 253s > tools::assertError(revparse_single(repo, "HEAD^")) 253s > 253s > ## Add another commit 253s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test.txt")) 253s > add(repo, "test.txt") 253s > commit(repo, "Second commit message") 253s [f6a60bc] 2025-03-15: Second commit message 253s > 253s > stopifnot(identical(revparse_single(repo, "HEAD^"), commit_1)) 253s > stopifnot(is_blob(revparse_single(repo, "HEAD:test.txt"))) 253s > 253s > ## Cleanup 253s > unlink(path, recursive = TRUE) 253s > 253s BEGIN TEST signature.R 253s 253s R version 4.4.3 (2025-02-28) -- "Trophy Case" 253s Copyright (C) 2025 The R Foundation for Statistical Computing 253s Platform: s390x-ibm-linux-gnu 253s 253s R is free software and comes with ABSOLUTELY NO WARRANTY. 253s You are welcome to redistribute it under certain conditions. 253s Type 'license()' or 'licence()' for distribution details. 253s 253s R is a collaborative project with many contributors. 253s Type 'contributors()' for more information and 253s 'citation()' on how to cite R or R packages in publications. 253s 253s Type 'demo()' for some demos, 'help()' for on-line help, or 253s 'help.start()' for an HTML browser interface to help. 253s Type 'q()' to quit R. 253s 254s > ## git2r, R bindings to the libgit2 library. 254s > ## Copyright (C) 2013-2023 The git2r contributors 254s > ## 254s > ## This program is free software; you can redistribute it and/or modify 254s > ## it under the terms of the GNU General Public License, version 2, 254s > ## as published by the Free Software Foundation. 254s > ## 254s > ## git2r is distributed in the hope that it will be useful, 254s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 254s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 254s > ## GNU General Public License for more details. 254s > ## 254s > ## You should have received a copy of the GNU General Public License along 254s > ## with this program; if not, write to the Free Software Foundation, Inc., 254s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 254s > 254s > library("git2r") 254s > 254s > ## For debugging 254s > sessionInfo() 254s R version 4.4.3 (2025-02-28) 254s Platform: s390x-ibm-linux-gnu 254s Running under: Ubuntu Plucky Puffin (development branch) 254s 254s Matrix products: default 254s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 254s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 254s 254s locale: 254s [1] C 254s 254s time zone: Etc/UTC 254s tzcode source: system (glibc) 254s 254s attached base packages: 254s [1] stats graphics grDevices utils datasets methods base 254s 254s other attached packages: 254s [1] git2r_0.35.0 254s 254s loaded via a namespace (and not attached): 254s [1] compiler_4.4.3 254s > libgit2_version() 254s $major 254s [1] 1 254s 254s $minor 254s [1] 9 254s 254s $rev 254s [1] 0 254s 254s > libgit2_features() 254s $threads 254s [1] TRUE 254s 254s $https 254s [1] TRUE 254s 254s $ssh 254s [1] TRUE 254s 254s > 254s > 254s > ## Check printing of a class git_signature 254s > when <- structure(list(time = 1395567947, offset = 60), 254s + class = "git_time") 254s > 254s > signature <- structure(list(name = "Alice", 254s + email = "alice@example.org", 254s + when = when), 254s + class = "git_signature") 254s > stopifnot(identical(print(signature), signature)) 254s name: Alice 254s email: alice@example.org 254s when: 2014-03-23 09:45:47 GMT 254s > 254s BEGIN TEST stash.R 254s 254s R version 4.4.3 (2025-02-28) -- "Trophy Case" 254s Copyright (C) 2025 The R Foundation for Statistical Computing 254s Platform: s390x-ibm-linux-gnu 254s 254s R is free software and comes with ABSOLUTELY NO WARRANTY. 254s You are welcome to redistribute it under certain conditions. 254s Type 'license()' or 'licence()' for distribution details. 254s 254s R is a collaborative project with many contributors. 254s Type 'contributors()' for more information and 254s 'citation()' on how to cite R or R packages in publications. 254s 254s Type 'demo()' for some demos, 'help()' for on-line help, or 254s 'help.start()' for an HTML browser interface to help. 254s Type 'q()' to quit R. 254s 254s > ## git2r, R bindings to the libgit2 library. 254s > ## Copyright (C) 2013-2023 The git2r contributors 254s > ## 254s > ## This program is free software; you can redistribute it and/or modify 254s > ## it under the terms of the GNU General Public License, version 2, 254s > ## as published by the Free Software Foundation. 254s > ## 254s > ## git2r is distributed in the hope that it will be useful, 254s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 254s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 254s > ## GNU General Public License for more details. 254s > ## 254s > ## You should have received a copy of the GNU General Public License along 254s > ## with this program; if not, write to the Free Software Foundation, Inc., 254s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 254s > 254s > library("git2r") 254s > 254s > ## For debugging 254s > sessionInfo() 254s R version 4.4.3 (2025-02-28) 254s Platform: s390x-ibm-linux-gnu 254s Running under: Ubuntu Plucky Puffin (development branch) 254s 254s Matrix products: default 254s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 254s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 254s 254s locale: 254s [1] C 254s 254s time zone: Etc/UTC 254s tzcode source: system (glibc) 254s 254s attached base packages: 254s [1] stats graphics grDevices utils datasets methods base 254s 254s other attached packages: 254s [1] git2r_0.35.0 254s 254s loaded via a namespace (and not attached): 254s [1] compiler_4.4.3 254s > libgit2_version() 254s $major 254s [1] 1 254s 254s $minor 254s [1] 9 254s 254s $rev 254s [1] 0 254s 254s > libgit2_features() 254s $threads 254s [1] TRUE 254s 254s $https 254s [1] TRUE 254s 254s $ssh 254s [1] TRUE 254s 254s > 254s > 254s > ## Create a directory in tempdir 254s > path <- tempfile(pattern = "git2r-") 254s > dir.create(path) 254s > 254s > ## Initialize a repository 254s > repo <- init(path) 254s > config(repo, user.name = "Alice", user.email = "alice@example.org") 254s > 254s > ## Create a file 254s > writeLines("Hello world!", file.path(path, "test-1.txt")) 254s > 254s > ## add and commit 254s > add(repo, "test-1.txt") 254s > commit(repo, "Commit message") 254s [e2d01a3] 2025-03-15: Commit message 254s > 254s > ## Pop stash 254s > writeLines(c("Hello world!", "HELLO WORLD!"), file.path(path, "test-1.txt")) 254s > stash(repo) 254s > stopifnot(identical("Hello world!", 254s + readLines(file.path(path, "test-1.txt")))) 254s > stash_pop(repo) 254s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 254s + readLines(file.path(path, "test-1.txt")))) 254s > 254s > ## Make one more commit 254s > add(repo, "test-1.txt") 254s > commit(repo, "Next commit message") 254s [de9e519] 2025-03-15: Next commit message 254s > 254s > ## Check that there are no stashes 254s > stopifnot(identical(stash_list(repo), list())) 254s > 254s > ## Apply stash 254s > writeLines(c("Hello world!", "HELLO WORLD!", "hello world!"), 254s + file.path(path, "test-1.txt")) 254s > stash(repo) 254s > stopifnot(identical(c("Hello world!", "HELLO WORLD!"), 254s + readLines(file.path(path, "test-1.txt")))) 254s > stash_apply(repo) 254s > stopifnot(identical(c("Hello world!", "HELLO WORLD!", "hello world!"), 254s + readLines(file.path(path, "test-1.txt")))) 254s > stopifnot(identical(length(stash_list(repo)), 1L)) 254s > stash_drop(repo, 1) 254s > stopifnot(identical(stash_list(repo), list())) 254s > 254s > ## Make one more commit 254s > add(repo, "test-1.txt") 254s > commit(repo, "Apply stash commit message") 254s [c331340] 2025-03-15: Apply stash commit message 254s > 254s > ## Create one more file 254s > writeLines("Hello world!", file.path(path, "test-2.txt")) 254s > 254s > ## Check that there are no stashes 254s > stopifnot(identical(stash_list(repo), list())) 254s > 254s > ## Stash 254s > stash(repo) 254s > stopifnot(identical(stash_list(repo), list())) 254s > s <- stash(repo, untracked = TRUE) 254s > stopifnot(identical(print(s), s)) 254s On master: 2025-03-15 18:08:01.219255 254s 254s > summary(s) 254s message: On master: 2025-03-15 18:08:01.219255 254s stasher: Alice 254s when: 2025-03-15 18:08:01 GMT 254s sha: 6f2f810590741db012c40c9ff3fa9ac3e78f8683 254s 254s > stopifnot(identical(length(stash_list(repo)), 1L)) 254s > tree(stash_list(repo)[[1]]) 254s tree: af5711badde07055d853088e98c6d988bfdd139f 254s 254s mode type sha name 254s 1 100644 blob 5b168e5ff4e9eeff020b99a3c1c83c4979294e76 test-1.txt 254s > 254s > ## Drop stash 254s > stash_drop(repo, 1) 254s > stopifnot(identical(stash_list(repo), list())) 254s > 254s > ## Check stash_drop argument 254s > tools::assertError(stash_drop(repo)) 254s > tools::assertError(stash_drop(repo, -1)) 254s > tools::assertError(stash_drop(repo, 0.5)) 254s > 254s > ## Create one more file 254s > writeLines("Hello world!", file.path(path, "test-3.txt")) 254s > 254s > ## Create stash in repository 254s > stash(repo, untracked = TRUE) 254s > stopifnot(identical(length(stash_list(repo)), 1L)) 254s > 254s > ## Check stash_list method with missing repo argument 254s > wd <- setwd(path) 254s > stopifnot(identical(length(stash_list()), 1L)) 254s > if (!is.null(wd)) 254s + setwd(wd) 254s > 254s > ## Drop git_stash object in repository 254s > stash_drop(stash_list(repo)[[1]]) 254s > 254s > ## Cleanup 254s > unlink(path, recursive = TRUE) 254s > 254s BEGIN TEST status.R 254s 254s R version 4.4.3 (2025-02-28) -- "Trophy Case" 254s Copyright (C) 2025 The R Foundation for Statistical Computing 254s Platform: s390x-ibm-linux-gnu 254s 254s R is free software and comes with ABSOLUTELY NO WARRANTY. 254s You are welcome to redistribute it under certain conditions. 254s Type 'license()' or 'licence()' for distribution details. 254s 254s R is a collaborative project with many contributors. 254s Type 'contributors()' for more information and 254s 'citation()' on how to cite R or R packages in publications. 254s 254s Type 'demo()' for some demos, 'help()' for on-line help, or 254s 'help.start()' for an HTML browser interface to help. 254s Type 'q()' to quit R. 254s 254s > ## git2r, R bindings to the libgit2 library. 254s > ## Copyright (C) 2013-2023 The git2r contributors 254s > ## 254s > ## This program is free software; you can redistribute it and/or modify 254s > ## it under the terms of the GNU General Public License, version 2, 254s > ## as published by the Free Software Foundation. 254s > ## 254s > ## git2r is distributed in the hope that it will be useful, 254s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 254s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 254s > ## GNU General Public License for more details. 254s > ## 254s > ## You should have received a copy of the GNU General Public License along 254s > ## with this program; if not, write to the Free Software Foundation, Inc., 254s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 254s > 254s > library(git2r) 254s > source("util/check.R") 254s > 254s > ## For debugging 254s > sessionInfo() 254s R version 4.4.3 (2025-02-28) 254s Platform: s390x-ibm-linux-gnu 254s Running under: Ubuntu Plucky Puffin (development branch) 254s 254s Matrix products: default 254s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 254s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 254s 254s locale: 254s [1] C 254s 254s time zone: Etc/UTC 254s tzcode source: system (glibc) 254s 254s attached base packages: 254s [1] stats graphics grDevices utils datasets methods base 254s 254s other attached packages: 254s [1] git2r_0.35.0 254s 254s loaded via a namespace (and not attached): 254s [1] compiler_4.4.3 254s > libgit2_version() 254s $major 254s [1] 1 254s 254s $minor 254s [1] 9 254s 254s $rev 254s [1] 0 254s 254s > libgit2_features() 254s $threads 254s [1] TRUE 254s 254s $https 254s [1] TRUE 254s 254s $ssh 254s [1] TRUE 254s 254s > 254s > 254s > ## Create a directory in tempdir 254s > path <- tempfile(pattern = "git2r-") 254s > dir.create(path) 254s > 254s > ## Initialize a repository 254s > repo <- init(path) 254s > config(repo, user.name = "Alice", user.email = "alice@example.org") 254s > 254s > ## Status case 1 254s > status_exp_1 <- structure(list(staged = empty_named_list(), 254s + unstaged = empty_named_list(), 254s + untracked = empty_named_list()), 254s + class = "git_status") 254s > status_obs_1 <- status(repo) 254s > stopifnot(identical(print(status_obs_1), status_obs_1)) 254s working directory clean 254s > str(status_exp_1) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked: Named list() 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_1) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked: Named list() 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_1, status_exp_1)) 254s > stopifnot(identical(capture.output(status(repo)), 254s + "working directory clean")) 254s > 254s > ## Status case 2, include ignored files 254s > status_exp_2 <- structure(list(staged = empty_named_list(), 254s + unstaged = empty_named_list(), 254s + untracked = empty_named_list(), 254s + ignored = empty_named_list()), 254s + class = "git_status") 254s > status_obs_2 <- status(repo, ignored = TRUE) 254s > status_obs_2 254s working directory clean 254s > str(status_exp_2) 254s List of 4 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked: Named list() 254s $ ignored : Named list() 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_2) 254s List of 4 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked: Named list() 254s $ ignored : Named list() 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_2, status_exp_2)) 254s > stopifnot(identical(capture.output(status(repo, ignored = TRUE)), 254s + "working directory clean")) 254s > 254s > ## Create 4 files 254s > writeLines("File-1", file.path(path, "test-1.txt")) 254s > writeLines("File-2", file.path(path, "test-2.txt")) 254s > writeLines("File-3", file.path(path, "test-3.txt")) 254s > writeLines("File-4", file.path(path, "test-4.txt")) 254s > 254s > ## Status case 3: 4 untracked files 254s > status_exp_3 <- structure(list(staged = empty_named_list(), 254s + unstaged = empty_named_list(), 254s + untracked = list(untracked = "test-1.txt", 254s + untracked = "test-2.txt", 254s + untracked = "test-3.txt", 254s + untracked = "test-4.txt")), 254s + class = "git_status") 254s > status_obs_3 <- status(repo) 254s > status_obs_3 254s Untracked files: 254s Untracked: test-1.txt 254s Untracked: test-2.txt 254s Untracked: test-3.txt 254s Untracked: test-4.txt 254s 254s > str(status_exp_3) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked:List of 4 254s ..$ untracked: chr "test-1.txt" 254s ..$ untracked: chr "test-2.txt" 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_3) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked:List of 4 254s ..$ untracked: chr "test-1.txt" 254s ..$ untracked: chr "test-2.txt" 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_3, status_exp_3)) 254s > 254s > ## Add file 1 and 2 to the repository and commit 254s > add(repo, c("test-1.txt", "test-2.txt")) 254s > commit(repo, "Commit message") 254s [4b61dcf] 2025-03-15: Commit message 254s > 254s > ## Status case 4: 2 untracked files 254s > status_exp_4 <- structure(list(staged = empty_named_list(), 254s + unstaged = empty_named_list(), 254s + untracked = list(untracked = "test-3.txt", 254s + untracked = "test-4.txt")), 254s + class = "git_status") 254s > status_obs_4 <- status(repo) 254s > status_obs_4 254s Untracked files: 254s Untracked: test-3.txt 254s Untracked: test-4.txt 254s 254s > str(status_exp_4) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked:List of 2 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_4) 254s List of 3 254s $ staged : Named list() 254s $ unstaged : Named list() 254s $ untracked:List of 2 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_4, status_exp_4)) 254s > 254s > ## Update file 1 & 2 254s > writeLines(c("File-1", "Hello world"), file.path(path, "test-1.txt")) 254s > writeLines(c("File-2", "Hello world"), file.path(path, "test-2.txt")) 254s > 254s > ## Add file 1 254s > add(repo, "test-1.txt") 254s > 254s > ## Status case 5: 1 staged file, 1 unstaged file and 2 untracked files 254s > status_exp_5 <- structure(list(staged = list(modified = "test-1.txt"), 254s + unstaged = list(modified = "test-2.txt"), 254s + untracked = list(untracked = "test-3.txt", 254s + untracked = "test-4.txt")), 254s + class = "git_status") 254s > status_obs_5 <- status(repo) 254s > status_obs_5 254s Untracked files: 254s Untracked: test-3.txt 254s Untracked: test-4.txt 254s 254s Unstaged changes: 254s Modified: test-2.txt 254s 254s Staged changes: 254s Modified: test-1.txt 254s 254s > str(status_exp_5) 254s List of 3 254s $ staged :List of 1 254s ..$ modified: chr "test-1.txt" 254s $ unstaged :List of 1 254s ..$ modified: chr "test-2.txt" 254s $ untracked:List of 2 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_5) 254s List of 3 254s $ staged :List of 1 254s ..$ modified: chr "test-1.txt" 254s $ unstaged :List of 1 254s ..$ modified: chr "test-2.txt" 254s $ untracked:List of 2 254s ..$ untracked: chr "test-3.txt" 254s ..$ untracked: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_5, status_exp_5)) 254s > 254s > ## Add .gitignore file with file test-4.txt 254s > writeLines("test-4.txt", file.path(path, ".gitignore")) 254s > 254s > ## Status case 6: 1 staged file, 1 unstaged file, 2 untracked files 254s > ## and 1 ignored file 254s > status_exp_6 <- structure(list(staged = list(modified = "test-1.txt"), 254s + unstaged = list(modified = "test-2.txt"), 254s + untracked = list(untracked = ".gitignore", 254s + untracked = "test-3.txt"), 254s + ignored = list(ignored = "test-4.txt")), 254s + class = "git_status") 254s > status_obs_6 <- status(repo, ignore = TRUE) 254s > status_obs_6 254s Ignored files: 254s Ignored: test-4.txt 254s 254s Untracked files: 254s Untracked: .gitignore 254s Untracked: test-3.txt 254s 254s Unstaged changes: 254s Modified: test-2.txt 254s 254s Staged changes: 254s Modified: test-1.txt 254s 254s > str(status_exp_6) 254s List of 4 254s $ staged :List of 1 254s ..$ modified: chr "test-1.txt" 254s $ unstaged :List of 1 254s ..$ modified: chr "test-2.txt" 254s $ untracked:List of 2 254s ..$ untracked: chr ".gitignore" 254s ..$ untracked: chr "test-3.txt" 254s $ ignored :List of 1 254s ..$ ignored: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > str(status_obs_6) 254s List of 4 254s $ staged :List of 1 254s ..$ modified: chr "test-1.txt" 254s $ unstaged :List of 1 254s ..$ modified: chr "test-2.txt" 254s $ untracked:List of 2 254s ..$ untracked: chr ".gitignore" 254s ..$ untracked: chr "test-3.txt" 254s $ ignored :List of 1 254s ..$ ignored: chr "test-4.txt" 254s - attr(*, "class")= chr "git_status" 254s > stopifnot(identical(status_obs_6, status_exp_6)) 254s > 254s > ## Cleanup 254s > unlink(path, recursive = TRUE) 254s > 254s BEGIN TEST tag.R 254s 254s R version 4.4.3 (2025-02-28) -- "Trophy Case" 254s Copyright (C) 2025 The R Foundation for Statistical Computing 254s Platform: s390x-ibm-linux-gnu 254s 254s R is free software and comes with ABSOLUTELY NO WARRANTY. 254s You are welcome to redistribute it under certain conditions. 254s Type 'license()' or 'licence()' for distribution details. 254s 254s R is a collaborative project with many contributors. 254s Type 'contributors()' for more information and 254s 'citation()' on how to cite R or R packages in publications. 254s 254s Type 'demo()' for some demos, 'help()' for on-line help, or 254s 'help.start()' for an HTML browser interface to help. 254s Type 'q()' to quit R. 254s 254s > ## git2r, R bindings to the libgit2 library. 254s > ## Copyright (C) 2013-2023 The git2r contributors 254s > ## 254s > ## This program is free software; you can redistribute it and/or modify 254s > ## it under the terms of the GNU General Public License, version 2, 254s > ## as published by the Free Software Foundation. 254s > ## 254s > ## git2r is distributed in the hope that it will be useful, 254s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 254s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 254s > ## GNU General Public License for more details. 254s > ## 254s > ## You should have received a copy of the GNU General Public License along 254s > ## with this program; if not, write to the Free Software Foundation, Inc., 254s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 254s > 254s > library(git2r) 254s > source("util/check.R") 254s > 254s > ## For debugging 254s > sessionInfo() 254s R version 4.4.3 (2025-02-28) 254s Platform: s390x-ibm-linux-gnu 254s Running under: Ubuntu Plucky Puffin (development branch) 254s 254s Matrix products: default 254s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 254s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 254s 254s locale: 254s [1] C 254s 254s time zone: Etc/UTC 254s tzcode source: system (glibc) 254s 254s attached base packages: 254s [1] stats graphics grDevices utils datasets methods base 254s 254s other attached packages: 254s [1] git2r_0.35.0 254s 254s loaded via a namespace (and not attached): 254s [1] compiler_4.4.3 254s > libgit2_version() 254s $major 254s [1] 1 254s 254s $minor 254s [1] 9 254s 254s $rev 254s [1] 0 254s 254s > libgit2_features() 254s $threads 254s [1] TRUE 254s 254s $https 254s [1] TRUE 254s 254s $ssh 254s [1] TRUE 254s 254s > 254s > 254s > ## Create a directory in tempdir 254s > path <- tempfile(pattern = "git2r-") 254s > dir.create(path) 254s > 254s > ## Initialize a repository 254s > repo <- init(path) 254s > config(repo, user.name = "Alice", user.email = "alice@example.org") 254s > 254s > ## Create a file 254s > writeLines("Hello world!", file.path(path, "test.txt")) 254s > 254s > ## add and commit 254s > add(repo, "test.txt") 254s > commit(repo, "Commit message") 254s [c906e51] 2025-03-15: Commit message 254s > 254s > ## Check tags, no tag added 254s > stopifnot(identical(tags(repo), empty_named_list())) 254s > 254s > ## Create tag 254s > new_tag <- tag(repo, "Tagname", "Tag message") 254s > stopifnot(identical(print(new_tag), new_tag)) 254s [c906e5] Tagname 254s > summary(new_tag) 254s name: Tagname 254s target: c906e51c4df9489fe3e95f56ed03146c1c5869db 254s tagger: Alice 254s when: 2025-03-15 18:08:01 GMT 254s message: Tag message 254s > 254s > ## Check tag 254s > stopifnot(identical(lookup(repo, sha(new_tag)), new_tag)) 254s > stopifnot(identical(new_tag$name, "Tagname")) 254s > stopifnot(identical(new_tag$message, "Tag message")) 254s > stopifnot(identical(new_tag$tagger$name, "Alice")) 254s > stopifnot(identical(new_tag$tagger$email, "alice@example.org")) 254s > stopifnot(identical(length(tags(repo)), 1L)) 254s > stopifnot(identical(tags(repo)[[1]]$name, "Tagname")) 254s > stopifnot(identical(tags(repo)[[1]]$message, "Tag message")) 254s > stopifnot(identical(tags(repo)[[1]]$tagger$name, "Alice")) 254s > stopifnot(identical(tags(repo)[[1]]$tagger$email, "alice@example.org")) 254s > 254s > ## Check objects in object database 254s > stopifnot(identical(table(odb_objects(repo)$type), 254s + structure(c(1L, 1L, 1L, 1L), 254s + .Dim = 4L, 254s + .Dimnames = structure(list( 254s + c("blob", "commit", "tag", "tree")), 254s + .Names = ""), 254s + class = "table"))) 254s > 254s > ## Delete tag 254s > tag_delete(new_tag) 254s > stopifnot(identical(length(tags(repo)), 0L)) 254s > 254s > ## Create tag with session info 254s > tag(repo, "Tagname", "Tag message", session = TRUE) 254s > stopifnot(grep("git2r", tags(repo)[[1]]$message) > 0) 254s > 254s > ## Check tags method with default repo argument 254s > wd <- setwd(path) 254s > stopifnot(identical(length(tags()), 1L)) 254s > tag_delete(name = "Tagname") 254s > stopifnot(identical(length(tags()), 0L)) 254s > if (!is.null(wd)) 254s + setwd(wd) 254s > 254s > ## Cleanup 254s > unlink(path, recursive = TRUE) 254s > 254s BEGIN TEST time.R 254s 254s R version 4.4.3 (2025-02-28) -- "Trophy Case" 254s Copyright (C) 2025 The R Foundation for Statistical Computing 254s Platform: s390x-ibm-linux-gnu 254s 254s R is free software and comes with ABSOLUTELY NO WARRANTY. 254s You are welcome to redistribute it under certain conditions. 254s Type 'license()' or 'licence()' for distribution details. 254s 254s R is a collaborative project with many contributors. 254s Type 'contributors()' for more information and 254s 'citation()' on how to cite R or R packages in publications. 254s 254s Type 'demo()' for some demos, 'help()' for on-line help, or 254s 'help.start()' for an HTML browser interface to help. 254s Type 'q()' to quit R. 254s 254s > ## git2r, R bindings to the libgit2 library. 254s > ## Copyright (C) 2013-2023 The git2r contributors 254s > ## 254s > ## This program is free software; you can redistribute it and/or modify 254s > ## it under the terms of the GNU General Public License, version 2, 254s > ## as published by the Free Software Foundation. 254s > ## 254s > ## git2r is distributed in the hope that it will be useful, 254s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 254s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 254s > ## GNU General Public License for more details. 254s > ## 254s > ## You should have received a copy of the GNU General Public License along 254s > ## with this program; if not, write to the Free Software Foundation, Inc., 254s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 254s > 254s > library(git2r) 254s > 254s > ## For debugging 254s > sessionInfo() 254s R version 4.4.3 (2025-02-28) 254s Platform: s390x-ibm-linux-gnu 254s Running under: Ubuntu Plucky Puffin (development branch) 254s 254s Matrix products: default 254s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 254s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 254s 254s locale: 254s [1] C 254s 254s time zone: Etc/UTC 254s tzcode source: system (glibc) 254s 254s attached base packages: 254s [1] stats graphics grDevices utils datasets methods base 254s 254s other attached packages: 254s [1] git2r_0.35.0 254s 254s loaded via a namespace (and not attached): 254s [1] compiler_4.4.3 254s > libgit2_version() 254s $major 254s [1] 1 254s 254s $minor 254s [1] 9 254s 254s $rev 254s [1] 0 254s 254s > libgit2_features() 254s $threads 254s [1] TRUE 254s 254s $https 254s [1] TRUE 254s 254s $ssh 254s [1] TRUE 254s 254s > 254s > 254s > ## Test to coerce 254s > git_t <- structure(list(time = 1395567947, offset = 60), 254s + class = "git_time") 254s > stopifnot(identical(as.character(git_t), "2014-03-23 09:45:47 GMT")) 254s > stopifnot(identical(as.character(git_t, usetz = FALSE), "2014-03-23 09:45:47")) 254s > stopifnot(identical(as.POSIXct(git_t), 254s + as.POSIXct(1395567947, tz = "GMT", origin = "1970-01-01"))) 254s > stopifnot(identical(print(git_t), git_t)) 254s 2014-03-23 09:45:47 GMT 254s > 254s > as.POSIXct(1395567947, origin = "1970-01-01", tz = "-03") 254s [1] "2014-03-23 09:45:47" 254s > 254s > ## Test that origin/tz can be passed to as.POSIXct 254s > stopifnot(identical(as.POSIXct(git_t, tz = "Europe/Stockholm", 254s + origin = "1980-02-02"), 254s + as.POSIXct(1395567947, tz = "Europe/Stockholm", 254s + origin = "1980-02-02"))) 254s > 254s > ## Test that origin/tz can be passed to as.character 254s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 254s + origin = "1980-02-02"), 254s + "2024-04-23 11:45:47 CEST")) 254s > stopifnot(identical(as.character(git_t, tz = "Europe/Stockholm", 254s + origin = "1980-02-02", usetz = FALSE), 254s + "2024-04-23 11:45:47")) 254s > 254s > ## Test that origin/tz can be passed to print 254s > stopifnot(identical( 254s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 254s + origin = "1980-02-02")), 254s + "2024-04-23 11:45:47 CEST" 254s + )) 254s > stopifnot(identical( 254s + utils::capture.output(print(git_t, tz = "Europe/Stockholm", 254s + origin = "1980-02-02", usetz = FALSE)), 254s + "2024-04-23 11:45:47" 254s + )) 254s > 254s BEGIN TEST tree.R 254s 254s R version 4.4.3 (2025-02-28) -- "Trophy Case" 254s Copyright (C) 2025 The R Foundation for Statistical Computing 254s Platform: s390x-ibm-linux-gnu 254s 254s R is free software and comes with ABSOLUTELY NO WARRANTY. 254s You are welcome to redistribute it under certain conditions. 254s Type 'license()' or 'licence()' for distribution details. 254s 254s R is a collaborative project with many contributors. 254s Type 'contributors()' for more information and 254s 'citation()' on how to cite R or R packages in publications. 254s 254s Type 'demo()' for some demos, 'help()' for on-line help, or 254s 'help.start()' for an HTML browser interface to help. 254s Type 'q()' to quit R. 254s 255s > ## git2r, R bindings to the libgit2 library. 255s > ## Copyright (C) 2013-2023 The git2r contributors 255s > ## 255s > ## This program is free software; you can redistribute it and/or modify 255s > ## it under the terms of the GNU General Public License, version 2, 255s > ## as published by the Free Software Foundation. 255s > ## 255s > ## git2r is distributed in the hope that it will be useful, 255s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 255s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 255s > ## GNU General Public License for more details. 255s > ## 255s > ## You should have received a copy of the GNU General Public License along 255s > ## with this program; if not, write to the Free Software Foundation, Inc., 255s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 255s > 255s > library("git2r") 255s > 255s > ## For debugging 255s > sessionInfo() 255s R version 4.4.3 (2025-02-28) 255s Platform: s390x-ibm-linux-gnu 255s Running under: Ubuntu Plucky Puffin (development branch) 255s 255s Matrix products: default 255s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 255s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 255s 255s locale: 255s [1] C 255s 255s time zone: Etc/UTC 255s tzcode source: system (glibc) 255s 255s attached base packages: 255s [1] stats graphics grDevices utils datasets methods base 255s 255s other attached packages: 255s [1] git2r_0.35.0 255s 255s loaded via a namespace (and not attached): 255s [1] compiler_4.4.3 255s > libgit2_version() 255s $major 255s [1] 1 255s 255s $minor 255s [1] 9 255s 255s $rev 255s [1] 0 255s 255s > libgit2_features() 255s $threads 255s [1] TRUE 255s 255s $https 255s [1] TRUE 255s 255s $ssh 255s [1] TRUE 255s 255s > 255s > 255s > ## Create a directory in tempdir 255s > path <- tempfile(pattern = "git2r-") 255s > dir.create(path) 255s > 255s > ## Initialize a repository 255s > repo <- init(path) 255s > config(repo, user.name = "Alice", user.email = "alice@example.org") 255s > 255s > ## Create a file 255s > f <- file(file.path(path, "test.txt"), "wb") 255s > writeChar("Hello world!\n", f, eos = NULL) 255s > close(f) 255s > 255s > ## add and commit 255s > add(repo, "test.txt") 255s > commit(repo, "Commit message") 255s [c906e51] 2025-03-15: Commit message 255s > 255s > ## Check tree 255s > stopifnot(is_tree(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"))) 255s > stopifnot(identical( 255s + sha(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")), 255s + "a0b0b9e615e9e433eb5f11859e9feac4564c58c5")) 255s > stopifnot(is_tree(tree(commits(repo)[[1]]))) 255s > stopifnot(identical(lookup(repo, "a0b0b9e615e9e433eb5f11859e9feac4564c58c5"), 255s + tree(commits(repo)[[1]]))) 255s > stopifnot(identical(length(tree(commits(repo)[[1]])), 1L)) 255s > 255s > ## Coerce to a data.frame and check column names 255s > stopifnot(identical(names(as.data.frame(tree(commits(repo)[[1]]))), 255s + c("mode", "type", "sha", "name"))) 255s > 255s > ## Coerce to list and check length 255s > stopifnot(identical(length(as.list(tree(last_commit(repo)))), 1L)) 255s > 255s > ## Print and summary 255s > stopifnot(identical(print(tree(last_commit(repo))), tree(last_commit(repo)))) 255s tree: a0b0b9e615e9e433eb5f11859e9feac4564c58c5 255s 255s mode type sha name 255s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 255s > summary(tree(last_commit(repo))) 255s mode type sha name 255s 1 100644 blob cd0875583aabe89ee197ea133980a9085d08e497 test.txt 255s > 255s > ## Check indexing 255s > stopifnot(is_blob(tree(last_commit(repo))[TRUE])) 255s > stopifnot(is_blob(tree(last_commit(repo))["test.txt"])) 255s > res <- tools::assertError(tree(last_commit(repo))[data.frame()]) 255s > stopifnot(length(grep("Invalid index", res[[1]]$message)) > 0) 255s > 255s > ## Check ls_tree 255s > stopifnot(identical(ls_tree(repo = repo), ls_tree(repo = path))) 255s > stopifnot(identical(ls_tree(tree = sha(tree(last_commit(repo))), repo = repo), 255s + ls_tree(repo = repo))) 255s > 255s > ## Cleanup 255s > unlink(path, recursive = TRUE) 255s > 255s BEGIN TEST when.R 255s 255s R version 4.4.3 (2025-02-28) -- "Trophy Case" 255s Copyright (C) 2025 The R Foundation for Statistical Computing 255s Platform: s390x-ibm-linux-gnu 255s 255s R is free software and comes with ABSOLUTELY NO WARRANTY. 255s You are welcome to redistribute it under certain conditions. 255s Type 'license()' or 'licence()' for distribution details. 255s 255s R is a collaborative project with many contributors. 255s Type 'contributors()' for more information and 255s 'citation()' on how to cite R or R packages in publications. 255s 255s Type 'demo()' for some demos, 'help()' for on-line help, or 255s 'help.start()' for an HTML browser interface to help. 255s Type 'q()' to quit R. 255s 255s > ## git2r, R bindings to the libgit2 library. 255s > ## Copyright (C) 2013-2023 The git2r contributors 255s > ## 255s > ## This program is free software; you can redistribute it and/or modify 255s > ## it under the terms of the GNU General Public License, version 2, 255s > ## as published by the Free Software Foundation. 255s > ## 255s > ## git2r is distributed in the hope that it will be useful, 255s > ## but WITHOUT ANY WARRANTY; without even the implied warranty of 255s > ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 255s > ## GNU General Public License for more details. 255s > ## 255s > ## You should have received a copy of the GNU General Public License along 255s > ## with this program; if not, write to the Free Software Foundation, Inc., 255s > ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 255s > 255s > library("git2r") 255s > 255s > ## For debugging 255s > sessionInfo() 255s R version 4.4.3 (2025-02-28) 255s Platform: s390x-ibm-linux-gnu 255s Running under: Ubuntu Plucky Puffin (development branch) 255s 255s Matrix products: default 255s BLAS: /usr/lib/s390x-linux-gnu/blas/libblas.so.3.12.1 255s LAPACK: /usr/lib/s390x-linux-gnu/lapack/liblapack.so.3.12.1; LAPACK version 3.12.0 255s 255s locale: 255s [1] C 255s 255s time zone: Etc/UTC 255s tzcode source: system (glibc) 255s 255s attached base packages: 255s [1] stats graphics grDevices utils datasets methods base 255s 255s other attached packages: 255s [1] git2r_0.35.0 255s 255s loaded via a namespace (and not attached): 255s [1] compiler_4.4.3 255s > libgit2_version() 255s $major 255s [1] 1 255s 255s $minor 255s [1] 9 255s 255s $rev 255s [1] 0 255s 255s > libgit2_features() 255s $threads 255s [1] TRUE 255s 255s $https 255s [1] TRUE 255s 255s $ssh 255s [1] TRUE 255s 255s > 255s > 255s > ## Check when method 255s > w1 <- structure(list(time = 1395567947, offset = 60), 255s + class = "git_time") 255s > stopifnot(identical(when(w1), "2014-03-23 09:45:47 GMT")) 255s > stopifnot(identical(when(w1, usetz = FALSE), "2014-03-23 09:45:47")) 255s > stopifnot(identical(when(w1, tz = "Europe/Stockholm", origin = "1980-02-02"), 255s + "2024-04-23 11:45:47 CEST")) 255s > 255s > s1 <- structure(list(name = "Alice", email = "alice@example.org", when = w1), 255s + class = "git_signature") 255s > stopifnot(identical(when(s1), "2014-03-23 09:45:47 GMT")) 255s > stopifnot(identical(when(s1, usetz = FALSE), "2014-03-23 09:45:47")) 255s > stopifnot(identical(when(s1, tz = "Europe/Stockholm", origin = "1980-02-02"), 255s + "2024-04-23 11:45:47 CEST")) 255s > 255s > w2 <- structure(list(time = 1395567950, offset = 60), 255s + class = "git_time") 255s > s2 <- structure(list(name = "Alice", email = "alice@example.org", when = w2), 255s + class = "git_signature") 255s > c1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 255s + author = s1, 255s + committer = s2, 255s + summary = "A commit summary", 255s + message = "A commit message"), 255s + class = "git_commit") 255s > stopifnot(identical(when(c1), "2014-03-23 09:45:47 GMT")) 255s > stopifnot(identical(when(c1, usetz = FALSE), "2014-03-23 09:45:47")) 255s > stopifnot(identical(when(c1, tz = "Europe/Stockholm", origin = "1980-02-02"), 255s + "2024-04-23 11:45:47 CEST")) 255s > 255s > t1 <- structure(list(sha = "166f3f779fd7e4165aaa43f2828050ce040052b0", 255s + message = "A tag message", 255s + name = "A tage name", 255s + tagger = s1, 255s + target = "166f3f779fd7e4165aaa43f2828050ce040052b0"), 255s + class = "git_tag") 255s > stopifnot(identical(when(t1), "2014-03-23 09:45:47 GMT")) 255s > stopifnot(identical(when(t1, usetz = FALSE), "2014-03-23 09:45:47")) 255s > stopifnot(identical(when(t1, tz = "Europe/Stockholm", origin = "1980-02-02"), 255s + "2024-04-23 11:45:47 CEST")) 255s > 255s autopkgtest [18:08:02]: test run-unit-test: -----------------------] 256s autopkgtest [18:08:03]: test run-unit-test: - - - - - - - - - - results - - - - - - - - - - 256s run-unit-test PASS 256s autopkgtest [18:08:03]: test pkg-r-autopkgtest: preparing testbed 256s Reading package lists... 256s Building dependency tree... 256s Reading state information... 256s Starting pkgProblemResolver with broken count: 0 256s Starting 2 pkgProblemResolver with broken count: 0 256s Done 257s The following NEW packages will be installed: 257s build-essential cpp cpp-14 cpp-14-s390x-linux-gnu cpp-s390x-linux-gnu 257s dctrl-tools g++ g++-14 g++-14-s390x-linux-gnu g++-s390x-linux-gnu gcc gcc-14 257s gcc-14-s390x-linux-gnu gcc-s390x-linux-gnu gfortran gfortran-14 257s gfortran-14-s390x-linux-gnu gfortran-s390x-linux-gnu icu-devtools libasan8 257s libblas-dev libbz2-dev libcc1-0 libdeflate-dev libgcc-14-dev 257s libgfortran-14-dev libicu-dev libisl23 libitm1 libjpeg-dev 257s libjpeg-turbo8-dev libjpeg8-dev liblapack-dev liblzma-dev libmpc3 257s libncurses-dev libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix3 257s libpkgconf3 libpng-dev libreadline-dev libstdc++-14-dev libtirpc-dev 257s libubsan1 pkg-r-autopkgtest pkgconf pkgconf-bin r-base-dev zlib1g-dev 257s 0 upgraded, 51 newly installed, 0 to remove and 0 not upgraded. 257s Need to get 82.3 MB of archives. 257s After this operation, 279 MB of additional disk space will be used. 257s Get:1 http://ftpmaster.internal/ubuntu plucky/main s390x libisl23 s390x 0.27-1 [704 kB] 258s Get:2 http://ftpmaster.internal/ubuntu plucky/main s390x libmpc3 s390x 1.3.1-1build2 [57.8 kB] 258s Get:3 http://ftpmaster.internal/ubuntu plucky/main s390x cpp-14-s390x-linux-gnu s390x 14.2.0-17ubuntu3 [9572 kB] 268s Get:4 http://ftpmaster.internal/ubuntu plucky/main s390x cpp-14 s390x 14.2.0-17ubuntu3 [1028 B] 268s Get:5 http://ftpmaster.internal/ubuntu plucky/main s390x cpp-s390x-linux-gnu s390x 4:14.2.0-1ubuntu1 [5556 B] 268s Get:6 http://ftpmaster.internal/ubuntu plucky/main s390x cpp s390x 4:14.2.0-1ubuntu1 [22.4 kB] 268s Get:7 http://ftpmaster.internal/ubuntu plucky/main s390x libcc1-0 s390x 15-20250222-0ubuntu1 [49.2 kB] 268s Get:8 http://ftpmaster.internal/ubuntu plucky/main s390x libitm1 s390x 15-20250222-0ubuntu1 [31.2 kB] 268s Get:9 http://ftpmaster.internal/ubuntu plucky/main s390x libasan8 s390x 15-20250222-0ubuntu1 [2970 kB] 271s Get:10 http://ftpmaster.internal/ubuntu plucky/main s390x libubsan1 s390x 15-20250222-0ubuntu1 [1212 kB] 273s Get:11 http://ftpmaster.internal/ubuntu plucky/main s390x libgcc-14-dev s390x 14.2.0-17ubuntu3 [1037 kB] 274s Get:12 http://ftpmaster.internal/ubuntu plucky/main s390x gcc-14-s390x-linux-gnu s390x 14.2.0-17ubuntu3 [18.7 MB] 295s Get:13 http://ftpmaster.internal/ubuntu plucky/main s390x gcc-14 s390x 14.2.0-17ubuntu3 [526 kB] 296s Get:14 http://ftpmaster.internal/ubuntu plucky/main s390x gcc-s390x-linux-gnu s390x 4:14.2.0-1ubuntu1 [1204 B] 296s Get:15 http://ftpmaster.internal/ubuntu plucky/main s390x gcc s390x 4:14.2.0-1ubuntu1 [5004 B] 296s Get:16 http://ftpmaster.internal/ubuntu plucky/main s390x libstdc++-14-dev s390x 14.2.0-17ubuntu3 [2611 kB] 298s Get:17 http://ftpmaster.internal/ubuntu plucky/main s390x g++-14-s390x-linux-gnu s390x 14.2.0-17ubuntu3 [11.0 MB] 309s Get:18 http://ftpmaster.internal/ubuntu plucky/main s390x g++-14 s390x 14.2.0-17ubuntu3 [21.8 kB] 309s Get:19 http://ftpmaster.internal/ubuntu plucky/main s390x g++-s390x-linux-gnu s390x 4:14.2.0-1ubuntu1 [956 B] 309s Get:20 http://ftpmaster.internal/ubuntu plucky/main s390x g++ s390x 4:14.2.0-1ubuntu1 [1080 B] 309s Get:21 http://ftpmaster.internal/ubuntu plucky/main s390x build-essential s390x 12.10ubuntu1 [4930 B] 309s Get:22 http://ftpmaster.internal/ubuntu plucky/main s390x dctrl-tools s390x 2.24-3build3 [106 kB] 309s Get:23 http://ftpmaster.internal/ubuntu plucky/main s390x libgfortran-14-dev s390x 14.2.0-17ubuntu3 [654 kB] 310s Get:24 http://ftpmaster.internal/ubuntu plucky/main s390x gfortran-14-s390x-linux-gnu s390x 14.2.0-17ubuntu3 [10.3 MB] 320s Get:25 http://ftpmaster.internal/ubuntu plucky/main s390x gfortran-14 s390x 14.2.0-17ubuntu3 [13.6 kB] 320s Get:26 http://ftpmaster.internal/ubuntu plucky/main s390x gfortran-s390x-linux-gnu s390x 4:14.2.0-1ubuntu1 [1012 B] 320s Get:27 http://ftpmaster.internal/ubuntu plucky/main s390x gfortran s390x 4:14.2.0-1ubuntu1 [1160 B] 320s Get:28 http://ftpmaster.internal/ubuntu plucky/main s390x icu-devtools s390x 76.1-1ubuntu2 [225 kB] 320s Get:29 http://ftpmaster.internal/ubuntu plucky/main s390x libblas-dev s390x 3.12.1-2 [254 kB] 320s Get:30 http://ftpmaster.internal/ubuntu plucky/main s390x libbz2-dev s390x 1.0.8-6 [39.1 kB] 320s Get:31 http://ftpmaster.internal/ubuntu plucky/main s390x libdeflate-dev s390x 1.23-1 [52.2 kB] 320s Get:32 http://ftpmaster.internal/ubuntu plucky/main s390x libicu-dev s390x 76.1-1ubuntu2 [12.2 MB] 330s Get:33 http://ftpmaster.internal/ubuntu plucky/main s390x libjpeg-turbo8-dev s390x 2.1.5-3ubuntu2 [281 kB] 330s Get:34 http://ftpmaster.internal/ubuntu plucky/main s390x libjpeg8-dev s390x 8c-2ubuntu11 [1484 B] 330s Get:35 http://ftpmaster.internal/ubuntu plucky/main s390x libjpeg-dev s390x 8c-2ubuntu11 [1484 B] 330s Get:36 http://ftpmaster.internal/ubuntu plucky/main s390x liblapack-dev s390x 3.12.1-2 [5967 kB] 335s Get:37 http://ftpmaster.internal/ubuntu plucky/main s390x libncurses-dev s390x 6.5+20250216-2 [407 kB] 335s Get:38 http://ftpmaster.internal/ubuntu plucky/main s390x libpcre2-16-0 s390x 10.45-1 [259 kB] 335s Get:39 http://ftpmaster.internal/ubuntu plucky/main s390x libpcre2-32-0 s390x 10.45-1 [245 kB] 335s Get:40 http://ftpmaster.internal/ubuntu plucky/main s390x libpcre2-posix3 s390x 10.45-1 [7080 B] 335s Get:41 http://ftpmaster.internal/ubuntu plucky/main s390x libpcre2-dev s390x 10.45-1 [899 kB] 336s Get:42 http://ftpmaster.internal/ubuntu plucky/main s390x libpkgconf3 s390x 1.8.1-4 [31.2 kB] 336s Get:43 http://ftpmaster.internal/ubuntu plucky/main s390x zlib1g-dev s390x 1:1.3.dfsg+really1.3.1-1ubuntu1 [898 kB] 337s Get:44 http://ftpmaster.internal/ubuntu plucky/main s390x libpng-dev s390x 1.6.47-1 [278 kB] 337s Get:45 http://ftpmaster.internal/ubuntu plucky/main s390x libreadline-dev s390x 8.2-6 [187 kB] 337s Get:46 http://ftpmaster.internal/ubuntu plucky/main s390x liblzma-dev s390x 5.6.4-1 [183 kB] 337s Get:47 http://ftpmaster.internal/ubuntu plucky/main s390x pkgconf-bin s390x 1.8.1-4 [21.5 kB] 337s Get:48 http://ftpmaster.internal/ubuntu plucky/main s390x pkgconf s390x 1.8.1-4 [16.7 kB] 337s Get:49 http://ftpmaster.internal/ubuntu plucky/main s390x libtirpc-dev s390x 1.3.4+ds-1.3 [196 kB] 338s Get:50 http://ftpmaster.internal/ubuntu plucky/universe s390x r-base-dev all 4.4.3-1 [4176 B] 338s Get:51 http://ftpmaster.internal/ubuntu plucky/universe s390x pkg-r-autopkgtest all 20231212ubuntu1 [6448 B] 338s Fetched 82.3 MB in 1min 21s (1017 kB/s) 338s Selecting previously unselected package libisl23:s390x. 338s (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 ... 58580 files and directories currently installed.) 338s Preparing to unpack .../00-libisl23_0.27-1_s390x.deb ... 338s Unpacking libisl23:s390x (0.27-1) ... 338s Selecting previously unselected package libmpc3:s390x. 338s Preparing to unpack .../01-libmpc3_1.3.1-1build2_s390x.deb ... 338s Unpacking libmpc3:s390x (1.3.1-1build2) ... 338s Selecting previously unselected package cpp-14-s390x-linux-gnu. 338s Preparing to unpack .../02-cpp-14-s390x-linux-gnu_14.2.0-17ubuntu3_s390x.deb ... 338s Unpacking cpp-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 338s Selecting previously unselected package cpp-14. 338s Preparing to unpack .../03-cpp-14_14.2.0-17ubuntu3_s390x.deb ... 338s Unpacking cpp-14 (14.2.0-17ubuntu3) ... 338s Selecting previously unselected package cpp-s390x-linux-gnu. 338s Preparing to unpack .../04-cpp-s390x-linux-gnu_4%3a14.2.0-1ubuntu1_s390x.deb ... 338s Unpacking cpp-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 338s Selecting previously unselected package cpp. 338s Preparing to unpack .../05-cpp_4%3a14.2.0-1ubuntu1_s390x.deb ... 338s Unpacking cpp (4:14.2.0-1ubuntu1) ... 338s Selecting previously unselected package libcc1-0:s390x. 338s Preparing to unpack .../06-libcc1-0_15-20250222-0ubuntu1_s390x.deb ... 338s Unpacking libcc1-0:s390x (15-20250222-0ubuntu1) ... 338s Selecting previously unselected package libitm1:s390x. 338s Preparing to unpack .../07-libitm1_15-20250222-0ubuntu1_s390x.deb ... 338s Unpacking libitm1:s390x (15-20250222-0ubuntu1) ... 338s Selecting previously unselected package libasan8:s390x. 338s Preparing to unpack .../08-libasan8_15-20250222-0ubuntu1_s390x.deb ... 338s Unpacking libasan8:s390x (15-20250222-0ubuntu1) ... 338s Selecting previously unselected package libubsan1:s390x. 338s Preparing to unpack .../09-libubsan1_15-20250222-0ubuntu1_s390x.deb ... 338s Unpacking libubsan1:s390x (15-20250222-0ubuntu1) ... 338s Selecting previously unselected package libgcc-14-dev:s390x. 338s Preparing to unpack .../10-libgcc-14-dev_14.2.0-17ubuntu3_s390x.deb ... 338s Unpacking libgcc-14-dev:s390x (14.2.0-17ubuntu3) ... 338s Selecting previously unselected package gcc-14-s390x-linux-gnu. 338s Preparing to unpack .../11-gcc-14-s390x-linux-gnu_14.2.0-17ubuntu3_s390x.deb ... 338s Unpacking gcc-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package gcc-14. 339s Preparing to unpack .../12-gcc-14_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking gcc-14 (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package gcc-s390x-linux-gnu. 339s Preparing to unpack .../13-gcc-s390x-linux-gnu_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking gcc-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package gcc. 339s Preparing to unpack .../14-gcc_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking gcc (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package libstdc++-14-dev:s390x. 339s Preparing to unpack .../15-libstdc++-14-dev_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking libstdc++-14-dev:s390x (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package g++-14-s390x-linux-gnu. 339s Preparing to unpack .../16-g++-14-s390x-linux-gnu_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking g++-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package g++-14. 339s Preparing to unpack .../17-g++-14_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking g++-14 (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package g++-s390x-linux-gnu. 339s Preparing to unpack .../18-g++-s390x-linux-gnu_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking g++-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package g++. 339s Preparing to unpack .../19-g++_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking g++ (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package build-essential. 339s Preparing to unpack .../20-build-essential_12.10ubuntu1_s390x.deb ... 339s Unpacking build-essential (12.10ubuntu1) ... 339s Selecting previously unselected package dctrl-tools. 339s Preparing to unpack .../21-dctrl-tools_2.24-3build3_s390x.deb ... 339s Unpacking dctrl-tools (2.24-3build3) ... 339s Selecting previously unselected package libgfortran-14-dev:s390x. 339s Preparing to unpack .../22-libgfortran-14-dev_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking libgfortran-14-dev:s390x (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package gfortran-14-s390x-linux-gnu. 339s Preparing to unpack .../23-gfortran-14-s390x-linux-gnu_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking gfortran-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package gfortran-14. 339s Preparing to unpack .../24-gfortran-14_14.2.0-17ubuntu3_s390x.deb ... 339s Unpacking gfortran-14 (14.2.0-17ubuntu3) ... 339s Selecting previously unselected package gfortran-s390x-linux-gnu. 339s Preparing to unpack .../25-gfortran-s390x-linux-gnu_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking gfortran-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package gfortran. 339s Preparing to unpack .../26-gfortran_4%3a14.2.0-1ubuntu1_s390x.deb ... 339s Unpacking gfortran (4:14.2.0-1ubuntu1) ... 339s Selecting previously unselected package icu-devtools. 339s Preparing to unpack .../27-icu-devtools_76.1-1ubuntu2_s390x.deb ... 339s Unpacking icu-devtools (76.1-1ubuntu2) ... 339s Selecting previously unselected package libblas-dev:s390x. 339s Preparing to unpack .../28-libblas-dev_3.12.1-2_s390x.deb ... 339s Unpacking libblas-dev:s390x (3.12.1-2) ... 339s Selecting previously unselected package libbz2-dev:s390x. 339s Preparing to unpack .../29-libbz2-dev_1.0.8-6_s390x.deb ... 339s Unpacking libbz2-dev:s390x (1.0.8-6) ... 339s Selecting previously unselected package libdeflate-dev:s390x. 339s Preparing to unpack .../30-libdeflate-dev_1.23-1_s390x.deb ... 339s Unpacking libdeflate-dev:s390x (1.23-1) ... 339s Selecting previously unselected package libicu-dev:s390x. 339s Preparing to unpack .../31-libicu-dev_76.1-1ubuntu2_s390x.deb ... 339s Unpacking libicu-dev:s390x (76.1-1ubuntu2) ... 339s Selecting previously unselected package libjpeg-turbo8-dev:s390x. 339s Preparing to unpack .../32-libjpeg-turbo8-dev_2.1.5-3ubuntu2_s390x.deb ... 339s Unpacking libjpeg-turbo8-dev:s390x (2.1.5-3ubuntu2) ... 339s Selecting previously unselected package libjpeg8-dev:s390x. 339s Preparing to unpack .../33-libjpeg8-dev_8c-2ubuntu11_s390x.deb ... 339s Unpacking libjpeg8-dev:s390x (8c-2ubuntu11) ... 339s Selecting previously unselected package libjpeg-dev:s390x. 339s Preparing to unpack .../34-libjpeg-dev_8c-2ubuntu11_s390x.deb ... 339s Unpacking libjpeg-dev:s390x (8c-2ubuntu11) ... 339s Selecting previously unselected package liblapack-dev:s390x. 339s Preparing to unpack .../35-liblapack-dev_3.12.1-2_s390x.deb ... 339s Unpacking liblapack-dev:s390x (3.12.1-2) ... 340s Selecting previously unselected package libncurses-dev:s390x. 340s Preparing to unpack .../36-libncurses-dev_6.5+20250216-2_s390x.deb ... 340s Unpacking libncurses-dev:s390x (6.5+20250216-2) ... 340s Selecting previously unselected package libpcre2-16-0:s390x. 340s Preparing to unpack .../37-libpcre2-16-0_10.45-1_s390x.deb ... 340s Unpacking libpcre2-16-0:s390x (10.45-1) ... 340s Selecting previously unselected package libpcre2-32-0:s390x. 340s Preparing to unpack .../38-libpcre2-32-0_10.45-1_s390x.deb ... 340s Unpacking libpcre2-32-0:s390x (10.45-1) ... 340s Selecting previously unselected package libpcre2-posix3:s390x. 340s Preparing to unpack .../39-libpcre2-posix3_10.45-1_s390x.deb ... 340s Unpacking libpcre2-posix3:s390x (10.45-1) ... 340s Selecting previously unselected package libpcre2-dev:s390x. 340s Preparing to unpack .../40-libpcre2-dev_10.45-1_s390x.deb ... 340s Unpacking libpcre2-dev:s390x (10.45-1) ... 340s Selecting previously unselected package libpkgconf3:s390x. 340s Preparing to unpack .../41-libpkgconf3_1.8.1-4_s390x.deb ... 340s Unpacking libpkgconf3:s390x (1.8.1-4) ... 340s Selecting previously unselected package zlib1g-dev:s390x. 340s Preparing to unpack .../42-zlib1g-dev_1%3a1.3.dfsg+really1.3.1-1ubuntu1_s390x.deb ... 340s Unpacking zlib1g-dev:s390x (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 340s Selecting previously unselected package libpng-dev:s390x. 340s Preparing to unpack .../43-libpng-dev_1.6.47-1_s390x.deb ... 340s Unpacking libpng-dev:s390x (1.6.47-1) ... 340s Selecting previously unselected package libreadline-dev:s390x. 340s Preparing to unpack .../44-libreadline-dev_8.2-6_s390x.deb ... 340s Unpacking libreadline-dev:s390x (8.2-6) ... 340s Selecting previously unselected package liblzma-dev:s390x. 340s Preparing to unpack .../45-liblzma-dev_5.6.4-1_s390x.deb ... 340s Unpacking liblzma-dev:s390x (5.6.4-1) ... 340s Selecting previously unselected package pkgconf-bin. 340s Preparing to unpack .../46-pkgconf-bin_1.8.1-4_s390x.deb ... 340s Unpacking pkgconf-bin (1.8.1-4) ... 340s Selecting previously unselected package pkgconf:s390x. 340s Preparing to unpack .../47-pkgconf_1.8.1-4_s390x.deb ... 340s Unpacking pkgconf:s390x (1.8.1-4) ... 340s Selecting previously unselected package libtirpc-dev:s390x. 340s Preparing to unpack .../48-libtirpc-dev_1.3.4+ds-1.3_s390x.deb ... 340s Unpacking libtirpc-dev:s390x (1.3.4+ds-1.3) ... 340s Selecting previously unselected package r-base-dev. 340s Preparing to unpack .../49-r-base-dev_4.4.3-1_all.deb ... 340s Unpacking r-base-dev (4.4.3-1) ... 340s Selecting previously unselected package pkg-r-autopkgtest. 340s Preparing to unpack .../50-pkg-r-autopkgtest_20231212ubuntu1_all.deb ... 340s Unpacking pkg-r-autopkgtest (20231212ubuntu1) ... 340s Setting up libjpeg-turbo8-dev:s390x (2.1.5-3ubuntu2) ... 340s Setting up libncurses-dev:s390x (6.5+20250216-2) ... 340s Setting up libreadline-dev:s390x (8.2-6) ... 340s Setting up libpcre2-16-0:s390x (10.45-1) ... 340s Setting up libpcre2-32-0:s390x (10.45-1) ... 340s Setting up libtirpc-dev:s390x (1.3.4+ds-1.3) ... 340s Setting up libpkgconf3:s390x (1.8.1-4) ... 340s Setting up libmpc3:s390x (1.3.1-1build2) ... 340s Setting up icu-devtools (76.1-1ubuntu2) ... 340s Setting up pkgconf-bin (1.8.1-4) ... 340s Setting up liblzma-dev:s390x (5.6.4-1) ... 340s Setting up libubsan1:s390x (15-20250222-0ubuntu1) ... 340s Setting up zlib1g-dev:s390x (1:1.3.dfsg+really1.3.1-1ubuntu1) ... 340s Setting up libpcre2-posix3:s390x (10.45-1) ... 340s Setting up libasan8:s390x (15-20250222-0ubuntu1) ... 340s Setting up libjpeg8-dev:s390x (8c-2ubuntu11) ... 340s Setting up libisl23:s390x (0.27-1) ... 340s Setting up libdeflate-dev:s390x (1.23-1) ... 340s Setting up libicu-dev:s390x (76.1-1ubuntu2) ... 340s Setting up libcc1-0:s390x (15-20250222-0ubuntu1) ... 340s Setting up libblas-dev:s390x (3.12.1-2) ... 340s update-alternatives: using /usr/lib/s390x-linux-gnu/blas/libblas.so to provide /usr/lib/s390x-linux-gnu/libblas.so (libblas.so-s390x-linux-gnu) in auto mode 340s Setting up dctrl-tools (2.24-3build3) ... 340s Setting up libitm1:s390x (15-20250222-0ubuntu1) ... 340s Setting up libbz2-dev:s390x (1.0.8-6) ... 340s Setting up libpcre2-dev:s390x (10.45-1) ... 340s Setting up libpng-dev:s390x (1.6.47-1) ... 340s Setting up libjpeg-dev:s390x (8c-2ubuntu11) ... 340s Setting up pkgconf:s390x (1.8.1-4) ... 340s Setting up liblapack-dev:s390x (3.12.1-2) ... 340s update-alternatives: using /usr/lib/s390x-linux-gnu/lapack/liblapack.so to provide /usr/lib/s390x-linux-gnu/liblapack.so (liblapack.so-s390x-linux-gnu) in auto mode 340s Setting up cpp-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 340s Setting up cpp-14 (14.2.0-17ubuntu3) ... 340s Setting up libgcc-14-dev:s390x (14.2.0-17ubuntu3) ... 340s Setting up libstdc++-14-dev:s390x (14.2.0-17ubuntu3) ... 340s Setting up libgfortran-14-dev:s390x (14.2.0-17ubuntu3) ... 340s Setting up cpp-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 340s Setting up gcc-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 340s Setting up gcc-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 340s Setting up g++-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 340s Setting up cpp (4:14.2.0-1ubuntu1) ... 340s Setting up gfortran-14-s390x-linux-gnu (14.2.0-17ubuntu3) ... 340s Setting up g++-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 340s Setting up gcc-14 (14.2.0-17ubuntu3) ... 340s Setting up g++-14 (14.2.0-17ubuntu3) ... 340s Setting up gfortran-14 (14.2.0-17ubuntu3) ... 340s Setting up gfortran-s390x-linux-gnu (4:14.2.0-1ubuntu1) ... 340s Setting up gcc (4:14.2.0-1ubuntu1) ... 340s Setting up g++ (4:14.2.0-1ubuntu1) ... 340s update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode 340s Setting up build-essential (12.10ubuntu1) ... 340s Setting up gfortran (4:14.2.0-1ubuntu1) ... 340s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f95 (f95) in auto mode 340s 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 340s update-alternatives: using /usr/bin/gfortran to provide /usr/bin/f77 (f77) in auto mode 340s 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 340s Setting up r-base-dev (4.4.3-1) ... 340s Setting up pkg-r-autopkgtest (20231212ubuntu1) ... 340s Processing triggers for libc-bin (2.41-1ubuntu2) ... 340s Processing triggers for man-db (2.13.0-1) ... 341s Processing triggers for install-info (7.1.1-1) ... 342s autopkgtest [18:09:29]: test pkg-r-autopkgtest: /usr/share/dh-r/pkg-r-autopkgtest 342s autopkgtest [18:09:29]: test pkg-r-autopkgtest: [----------------------- 342s Test: Try to load the R library git2r 342s 342s R version 4.4.3 (2025-02-28) -- "Trophy Case" 342s Copyright (C) 2025 The R Foundation for Statistical Computing 342s Platform: s390x-ibm-linux-gnu 342s 342s R is free software and comes with ABSOLUTELY NO WARRANTY. 342s You are welcome to redistribute it under certain conditions. 342s Type 'license()' or 'licence()' for distribution details. 342s 342s R is a collaborative project with many contributors. 342s Type 'contributors()' for more information and 342s 'citation()' on how to cite R or R packages in publications. 342s 342s Type 'demo()' for some demos, 'help()' for on-line help, or 342s 'help.start()' for an HTML browser interface to help. 342s Type 'q()' to quit R. 342s 342s > library('git2r') 342s > 342s > 342s Other tests are currently unsupported! 342s They will be progressively added. 342s autopkgtest [18:09:29]: test pkg-r-autopkgtest: -----------------------] 343s autopkgtest [18:09:30]: test pkg-r-autopkgtest: - - - - - - - - - - results - - - - - - - - - - 343s pkg-r-autopkgtest PASS 343s autopkgtest [18:09:30]: @@@@@@@@@@@@@@@@@@@@ summary 343s run-unit-test PASS 343s pkg-r-autopkgtest PASS 361s nova [W] Using flock in prodstack6-s390x 361s Creating nova instance adt-plucky-s390x-r-cran-git2r-20250315-180347-juju-7f2275-prod-proposed-migration-environment-20-43ed09cc-9af8-42f9-99e5-2daa77a578a3 from image adt/ubuntu-plucky-s390x-server-20250315.img (UUID 3d3557fa-fd0f-4bba-9b89-8d5964e09f61)... 361s nova [W] Timed out waiting for 49c0968a-79c4-471d-ac8c-5e9641c34090 to get deleted.