Refactor git command's handling of repo and channel

dblsaiko
Mar 29, 2024, 9:33 PM
G2WWGRN2DSO7GGNMKYOGGMDYG42OQQPI76J45RFH27FMBOXUQL2AC

Dependencies

  • [2] FF4TXHN5 In `pijul git`, avoid diffing files not modified by a commit
  • [3] A3DMBJJA Upgrading the `git` subcommand to the latest Sanakirja and Libpijul
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [6] VGBH3ED6 The Git feature does not need to be async
  • [7] 3AZB5NUO Fixing the Git feature
  • [8] NHO3QO3W Return a clean error instead of a panic when the channel for a commit is not found in `pijul git`
  • [9] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [10] NEJOYVJB Fixing the Git feature

Change contents

  • edit in pijul/src/commands/git.rs at line 39
    [3.172]
    [3.172]
    use crate::commands::load_channel_exact;
  • replacement in pijul/src/commands/git.rs at line 46
    [3.52][2.230:316]()
    let repo = if let Ok(repo) = Repository::find_root(self.pijul_path.clone()) {
    [3.52]
    [3.138182]
    let repo = if let Ok(repo) = Repository::find_root(self.pijul_path.as_deref()) {
  • replacement in pijul/src/commands/git.rs at line 49
    [2.334][2.334:401]()
    Repository::init(self.pijul_path.clone(), None, None)?
    [2.334]
    [2.401]
    Repository::init(self.pijul_path.as_deref(), None, None)?
  • replacement in pijul/src/commands/git.rs at line 282
    [3.144237][3.13219:13296](),[3.13296][3.70:179](),[3.70][3.70:179]()
    let channel = if let Some(c) = txn.read().load_channel(&oid_)? {
    c
    } else {
    bail!("Channel not found: {:?}", oid);
    };
    [3.144237]
    [3.13297]
    let channel = load_channel_exact(&oid_, &*txn.read())?;