B:BD[
3.423] → [
3.423:484]
B:BD[
3.484] → [
3.484:587]
B:BD[
3.587] → [
3.587:591]
if *repo != "" {
err := os.Chdir(*repo)
if err != nil {
fmt.Fprintf(os.Stderr, "Error changing to directory of source repository: %v\n", err)
os.Exit(2)
}
// Make a clone of the repository to work with, so that we don't mess up the original.
tempDir, err := os.MkdirTemp("", "")
if err != nil {
printErrorAndExit("Error creating temporary directory:", err)
}
tempRepo := filepath.Join(tempDir, "repo")
_, err = exec.Command("pijul", "clone", *repo, tempRepo).Output()
if err != nil {
printErrorAndExit("Error cloning the repository:", err)
}
if err := os.Chdir(tempRepo); err != nil {
printErrorAndExit("Error changing to the clone of the repository:", err)