Groovy Documentation

org.ajoberstar.gradle.git.tasks
[Java] Class GitFetch

java.lang.Object
  org.gradle.api.DefaultTask
      org.ajoberstar.gradle.git.tasks.GitBase
          org.ajoberstar.gradle.git.tasks.GitFetch
All Implemented Interfaces:
AuthenticationSupported

public class GitFetch
extends GitBase

Task to fetch named heads or tags from one or more other repositories, along with the objects necessary to complete them.

Authors:
Alex Lixandru
Since:
0.2.1


Method Summary
void credentials(groovy.lang.Closure closure)

Configured the credentials to be used when cloning the repo.

void fetch()

Fetches remote changes into a local Git repository.

boolean getCheckFetchedObjects()

Gets whether received objects will be checked for validity.

PasswordCredentials getCredentials()

Gets the credentials to be used when cloning the repo.

boolean getDryRun()

Gets whether the fetch operation will be a dry run

java.lang.Object getFetchTags()

Gets whether tags will be fetched.

java.util.List getRefspecs()

Gets the refspecs of the fetch command.

java.lang.String getRemote()

Gets the name used to track the upstream repository.

boolean getRemoveDeletedRefs()

Gets whether refs which no longer exist in the source will be removed

boolean getThin()

Gets the thin-pack preference for fetch operation

void refspecs(java.lang.Object... refs)

Adds refspecs to fetch from the remote repository.

void setCheckFetchedObjects(boolean checkObjects)

If set to true, the received objects will be checked for validity.

void setCredentials(PasswordCredentials credentials)

Sets the credentials to use when cloning the repo.

void setDryRun(boolean dryRun)

Sets whether the fetch operation should be a dry run.

void setFetchTags(java.lang.Object fetchTags)

Sets the specification of annotated tag behavior during fetch.

void setRefspecs(java.util.List refsToFetch)

Sets refspecs for the fetch command.

void setRemote(java.lang.Object remote)

Sets the name used to track the upstream repository.

void setRemoveDeletedRefs(boolean remRefs)

If set to true, refs which no longer exist in the source will be removed.

void setThin(boolean thin)

Sets the thin-pack preference for fetch operation.

 
Methods inherited from class GitBase
getGit, getRepoDir, setRepoPath
 

Method Detail

credentials

ssWarnings("rawtypes")
	public
public void credentials(groovy.lang.Closure closure)
Configured the credentials to be used when cloning the repo. This will be passed a PasswordCredentials instance.
Parameters:
closure - the configuration closure


fetch

tion
	public
public void fetch()
Fetches remote changes into a local Git repository.


getCheckFetchedObjects

public
public boolean getCheckFetchedObjects()
Gets whether received objects will be checked for validity.
Returns:
whether objects will be checked for validity


getCredentials

@Option
al
	public
public PasswordCredentials getCredentials()
Gets the credentials to be used when cloning the repo.
Returns:
the credentials


getDryRun

public
public boolean getDryRun()
Gets whether the fetch operation will be a dry run
Returns:
whether the fetch operation will be a dry run


getFetchTags

@Option
al
	public
public java.lang.Object getFetchTags()
Gets whether tags will be fetched.
Returns:
the fetch mode for tags; either yes, no or auto


getRefspecs

@Option
al
	public
public java.util.List getRefspecs()
Gets the refspecs of the fetch command.
Returns:
the refspecs to fetch


getRemote

public
public java.lang.String getRemote()
Gets the name used to track the upstream repository. Defaults to origin if not set.
Returns:
the remote name


getRemoveDeletedRefs

public
public boolean getRemoveDeletedRefs()
Gets whether refs which no longer exist in the source will be removed
Returns:
whether refs which no longer exist in the source will be removed


getThin

public
public boolean getThin()
Gets the thin-pack preference for fetch operation
Returns:
true if a thin-pack mode will be used for transport or false otherwise


refspecs

public void refspecs(java.lang.Object... refs)
Adds refspecs to fetch from the remote repository.

The format of a refspec parameter is an optional plus +, followed by the source ref src, followed by a colon :, followed by the destination ref dst.

The remote ref that matches src is fetched, and if dst is not empty string, the local ref that matches it is fast-forwarded using src. If the optional plus + is used, the local ref is updated even if it does not result in a fast-forward update.

If no refspec is specified, all the remote-tracking branches will be fetched.
Parameters:
refs - the refspecs to fetch


setCheckFetchedObjects

public void setCheckFetchedObjects(boolean checkObjects)
If set to true, the received objects will be checked for validity. Defaults to false.
Parameters:
checkObjects - whether to check objects for validity


setCredentials

public void setCredentials(PasswordCredentials credentials)
Sets the credentials to use when cloning the repo.
Parameters:
credentials - the credentials


setDryRun

public void setDryRun(boolean dryRun)
Sets whether the fetch operation should be a dry run. Defaults to false.
Parameters:
dryRun - whether the fetch operation should be a dry run


setFetchTags

public void setFetchTags(java.lang.Object fetchTags)
Sets the specification of annotated tag behavior during fetch. Default mode is auto, which means tags are automatically followed if they point at a commit that is being fetched.
Parameters:
fetchTags - the specification of tag behavior during fetch. Must be one of the following values:
  • yes, if tags should be fetched,
  • no, if tags should not be fetched or
  • auto, for the default behavior


setRefspecs

ssWarnings("unchecked")
	public
public void setRefspecs(java.util.List refsToFetch)
Sets refspecs for the fetch command.

The format of a refspec parameter is an optional plus +, followed by the source ref src, followed by a colon :, followed by the destination ref dst.

The remote ref that matches src is fetched, and if dst is not empty string, the local ref that matches it is fast-forwarded using src. If the optional plus + is used, the local ref is updated even if it does not result in a fast-forward update.

If no refspec is specified, all the remote-tracking branches will be fetched.
Parameters:
refsToFetch - the refspecs to fetch


setRemote

public void setRemote(java.lang.Object remote)
Sets the name used to track the upstream repository. Defaults to origin if not set.
Parameters:
remote - the remote name


setRemoveDeletedRefs

public void setRemoveDeletedRefs(boolean remRefs)
If set to true, refs which no longer exist in the source will be removed. Defaults to false.
Parameters:
remRefs - whether refs which no longer exist should be removed


setThin

public void setThin(boolean thin)
Sets the thin-pack preference for fetch operation. Default setting is true (thin transport)
Parameters:
thin - whether the transport preference will be thin


 

Groovy Documentation