Skip to content

Commit

Permalink
Fetch the latest changes from remote after local cloning
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
  • Loading branch information
Warashi committed Dec 12, 2024
1 parent bb90ea0 commit 951826e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/git/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func (r *repo) CopyToModify(dest string) (Repo, error) {
return nil, err
}

// fetch the latest changes which doesn't exist in the local repository
if out, err := cloned.runGitCommand(context.Background(), "fetch"); err != nil {
return nil, formatCommandError(err, out)
}

return cloned, nil
}

Expand Down

0 comments on commit 951826e

Please sign in to comment.