Skip to main content

migrate_shadow_objects

Function migrate_shadow_objects 

Source
pub fn migrate_shadow_objects(
    context: &GitContext,
    cwd: &Path,
    shadow: &Path,
    new_oid: &str,
    old_base: &Base,
    keep_message: Option<&str>,
) -> Result<String, GitFailure>
Expand description

What: Packs the commit’s objects that the shadow holds and the real store lacks, and indexes the pack into the real store. Why: pack-objects --local leaves out objects reached through the shadow’s alternates, so the pack carries only what the landing introduces.

In TS you’d write (pseudocode):

const pack = await runShadowGit({ args: ['pack-objects', '--revs', '--local', '--stdout', '--quiet'] });
await runTransactionGit({ args: ['index-pack', '--stdin', `--keep=${keepMessage}`], input: pack });