Skip to content

Checkout of remote branch does not sync files with IRIS #783

Closed
@raymond-rebbeck

Description

@raymond-rebbeck

On latest main branch (likely previous versions but have not tested) if you checkout a remote branch (one that does not exist as a local branch) then the files are not synced with IRIS.

This appears to be related to the below block of code where the diff for the sync is performed prior to the checkout command being performed. One cannot simply perform a diff on a remote branch without either already having checked it out or prefixing the name with 'origin/' or something similar. Therefore the diff sees no differences and nothing is synced.

if syncIrisWithDiff && (command '= "pull") {
if diffBase = "" {
set diffBase = ..GetCurrentBranch()
}
do ..RunGitCommand("fetch", .errorStream, .outputStream,"--prune")
kill errorStream, outputStream
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("diff",,.errorStream,.outputStream, diffBase_$Case(diffCompare,"":"",:"..")_diffCompare, "--name-status")
do ..ParseDiffStream(outputStream,,.files)
}

My initial thoughts are that something similar to what was done for the pull command in #517 could be applied so that the diff is performed after the checkout command is run. It's slightly more complicated though as a checkout can be performed both via the IDE menu and from Git UI. Both situations would need to be handled.

IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:04:37 EDT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions