br.com.objectos.git
Class MaterializeCommand

java.lang.Object
  extended by br.com.objectos.concurrent.StageComputationTask<V>
      extended by br.com.objectos.git.StageGitCommand<Directory>
          extended by br.com.objectos.git.MaterializeCommand
All Implemented Interfaces:
Computation<Directory>, CpuTask, br.com.objectos.core.object.ToStringObject, GitCommand<Directory>

public final class MaterializeCommand
extends StageGitCommand<Directory>

A command for materializing a Git repository.

To materialize a specific commit or a specific ref from a source repository into a target directory means to recursively create, at the target directory, the tree associated with the commit.

In other words, this command behaves like a git clone except it does not copy the whole history of the repository; in fact it will not create the .git directory at the target directory at all.

Since:
3

Constructor Summary
MaterializeCommand(Directory source, ObjectId commit, Directory target)
          Materializes from the source repository the specified commit to the target directory.
MaterializeCommand(Directory source, RefName ref, Directory target)
          Materializes from the source repository the specified ref to the target directory.
 
Method Summary
protected  void executeStage(int stage)
          
 void formatToString(StringBuilder toString, int level)
          
 
Methods inherited from class br.com.objectos.git.StageGitCommand
copyObjects, copyTree, executeFinally, materializeEntry, openRepository, readBlob, readCommit, readTree, resolve, submit, submitAsync, toString, updateRef, writeCommit, writeTree
 
Methods inherited from class br.com.objectos.concurrent.StageComputationTask
addComputation, executeOne, get, getAll, getResult, goTo, hasComputations, isActive, isComputing, reset, setResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface br.com.objectos.concurrent.Computation
getResult, isActive
 

Constructor Detail

MaterializeCommand

public MaterializeCommand(Directory source,
                          ObjectId commit,
                          Directory target)
Materializes from the source repository the specified commit to the target directory.

Parameters:
source - the source directory containing the Git repository
commit - the hash value of the containing pointing to the tree to be materialized
target - the target directory

MaterializeCommand

public MaterializeCommand(Directory source,
                          RefName ref,
                          Directory target)
Materializes from the source repository the specified ref to the target directory.

Parameters:
source - the source directory containing the Git repository
ref - the Git reference to be materialized
target - the target directory
Method Detail

formatToString

public final void formatToString(StringBuilder toString,
                                 int level)

Specified by:
formatToString in interface br.com.objectos.core.object.ToStringObject
Overrides:
formatToString in class StageGitCommand<Directory>

executeStage

protected final void executeStage(int stage)
                           throws Exception

Specified by:
executeStage in class StageComputationTask<Directory>
Throws:
Exception


Copyright © 2020–2022 Objectos Software LTDA. All rights reserved.