Skip to content

Commit

Permalink
All deprecated methods and properties removed
Browse files Browse the repository at this point in the history
This resolves #67
  • Loading branch information
ajoberstar committed Jul 23, 2017
1 parent 7113366 commit 944dc82
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 72 deletions.
36 changes: 0 additions & 36 deletions src/main/groovy/org/ajoberstar/grgit/Grgit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -194,40 +194,4 @@ class Grgit implements AutoCloseable {
OpSyntaxUtil.tryOp(Grgit, STATIC_OPERATIONS, [] as Object[], name, args)
}
}

/**
* Opens a {@code Grgit} instance by looking up the correct repo dir.
* This is a workaround due to the existing deprecated methods.
*/
static Grgit open() {
return OpSyntaxUtil.tryOp(Grgit, STATIC_OPERATIONS, [] as Object[], 'open', [] as Object[])
}

/**
* Opens a {@code Grgit} instance in {@code rootDirPath}. If credentials
* are provided they will be used for all operations with using remotes.
* @param rootDirPath path to the repository's root directory
* @param creds harcoded credentials to use for remote operations
* @deprecated replaced by {@link org.ajoberstar.grgit.operation.OpenOp}
* @throws GrgitException if an existing Git repository can't be opened
* in {@code rootDirPath}
*/
@Deprecated
static Grgit open(String rootDirPath, Credentials creds = null) {
return open(new File(rootDirPath), creds)
}

/**
* Opens a {@code Grgit} instance in {@code rootDir}. If credentials
* are provided they will be used for all operations with using remotes.
* @param rootDir path to the repository's root directory
* @param creds harcoded credentials to use for remote operations
* @deprecated replaced by {@link org.ajoberstar.grgit.operation.OpenOp}
* @throws GrgitException if an existing Git repository can't be opened
* in {@code rootDir}
*/
@Deprecated
static Grgit open(File rootDir, Credentials creds = null) {
return OpSyntaxUtil.tryOp(Grgit, STATIC_OPERATIONS, [] as Object[], 'open', [dir: rootDir, creds: creds])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,4 @@ class BranchStatusOp implements Callable<BranchStatus> {
throw new GrgitException('Problem retrieving branch status.', e)
}
}

/**
* @deprecated replaced by {@link #name}
*/
@Deprecated
Object getBranch() {
return name
}

/**
* @deprecated replaced by {@link #name}
*/
@Deprecated
void setBranch(Object branch) {
this.name = branch
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,4 @@ class BranchStatusOpSpec extends MultiGitOpSpec {
'up-to-date' | new BranchStatus(branch: GitTestUtil.branch('refs/heads/up-to-date', 'refs/remotes/origin/up-to-date'), aheadCount: 0, behindCount: 0)
'out-of-date' | new BranchStatus(branch: GitTestUtil.branch('refs/heads/out-of-date', 'refs/remotes/origin/out-of-date'), aheadCount: 2, behindCount: 1)
}

def 'deprecated property still works as map'() {
expect:
localGrgit.branch.status(branch: 'up-to-date') == new BranchStatus(
branch: GitTestUtil.branch('refs/heads/up-to-date', 'refs/remotes/origin/up-to-date'),
aheadCount: 0,
behindCount: 0
)
}

def 'deprecated property still works as closure'() {
expect:
localGrgit.branch.status {
branch = 'up-to-date'
} == new BranchStatus(
branch: GitTestUtil.branch('refs/heads/up-to-date', 'refs/remotes/origin/up-to-date'),
aheadCount: 0,
behindCount: 0
)
}
}

0 comments on commit 944dc82

Please sign in to comment.