use of org.eclipse.egit.github.core.Reference in project Bitocle by mthli.
the class RepoContentTask method doInBackground.
@Override
protected Boolean doInBackground(Void... params) {
if (flag == Flag.REPO_CONTENT_FIRST || flag == Flag.REPO_CONTENT_REFRESH) {
String master = "heads/master";
RepositoryId id = RepositoryId.create(owner, name);
Reference ref;
String sha;
if (!fragment.isToggle()) {
try {
ref = dataService.getReference(id, master);
} catch (IOException i) {
return false;
}
sha = ref.getObject().getSha();
if (isCancelled()) {
return false;
}
} else {
sha = fragment.getBookmarkItem().getSha();
}
try {
root = dataService.getTree(id, sha, true);
} catch (IOException i) {
return false;
}
}
if (isCancelled()) {
return false;
}
return true;
}
use of org.eclipse.egit.github.core.Reference in project Bitocle by mthli.
the class StarContentTask method doInBackground.
@Override
protected Boolean doInBackground(Void... params) {
if (flag == Flag.STAR_CONTENT_FIRST || flag == Flag.STAR_CONTENT_REFRESH) {
String master = "heads/master";
RepositoryId id = RepositoryId.create(owner, name);
Reference ref;
String sha;
if (!fragment.isToggle()) {
try {
ref = dataService.getReference(id, master);
} catch (IOException i) {
return false;
}
sha = ref.getObject().getSha();
if (isCancelled()) {
return false;
}
} else {
sha = fragment.getBookmarkItem().getSha();
}
try {
root = dataService.getTree(id, sha, true);
} catch (IOException i) {
return false;
}
}
if (isCancelled()) {
return false;
}
return true;
}
Aggregations