mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-06 02:09:44 +03:00
Workaround commit offset truncation through GDNative
This commit is contained in:
@@ -448,21 +448,21 @@ Array GitAPI::_get_previous_commits() {
|
|||||||
git_oid oid;
|
git_oid oid;
|
||||||
Array commits;
|
Array commits;
|
||||||
char commit_id[GIT_OID_HEXSZ + 1];
|
char commit_id[GIT_OID_HEXSZ + 1];
|
||||||
const git_signature *sig;
|
|
||||||
for (int i = 0; !git_revwalk_next(&oid, walker.get()) && i <= max_commit_fetch; i++) {
|
for (int i = 0; !git_revwalk_next(&oid, walker.get()) && i <= max_commit_fetch; i++) {
|
||||||
git_commit_ptr commit;
|
git_commit_ptr commit;
|
||||||
GIT2_PTR_R("Failed to lookup the commit", commits,
|
GIT2_PTR_R("Failed to lookup the commit", commits,
|
||||||
git_commit_lookup, commit, repo.get(), &oid);
|
git_commit_lookup, commit, repo.get(), &oid);
|
||||||
|
|
||||||
sig = git_commit_author(commit.get());
|
|
||||||
git_oid_tostr(commit_id, GIT_OID_HEXSZ + 1, git_commit_id(commit.get()));
|
git_oid_tostr(commit_id, GIT_OID_HEXSZ + 1, git_commit_id(commit.get()));
|
||||||
|
|
||||||
String msg = git_commit_message(commit.get());
|
String msg = git_commit_message(commit.get());
|
||||||
String author = sig->name;
|
String author = git_commit_author(commit.get())->name;
|
||||||
int64_t when = (int64_t)sig->when.time + (int64_t)(sig->when.offset * 60);
|
author = author + " <" + String(git_commit_author(commit.get())->email) + ">";
|
||||||
|
int64_t when = git_commit_time(commit.get());
|
||||||
|
int64_t offset = git_commit_time_offset(commit.get());
|
||||||
String hex_id = commit_id;
|
String hex_id = commit_id;
|
||||||
|
|
||||||
Dictionary commit_info = create_commit(msg, author, hex_id, when);
|
Dictionary commit_info = create_commit(msg, author, hex_id, String::num_int64(when), offset);
|
||||||
|
|
||||||
commits.push_back(commit_info);
|
commits.push_back(commit_info);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,13 +90,13 @@ class GitAPI : public EditorVCSInterface {
|
|||||||
void _discard_file(const String file_path);
|
void _discard_file(const String file_path);
|
||||||
void _fetch(const String remote, const String username, const String password);
|
void _fetch(const String remote, const String username, const String password);
|
||||||
Array _get_branch_list();
|
Array _get_branch_list();
|
||||||
Array _get_remotes();
|
|
||||||
String _get_current_branch_name(const bool full_ref);
|
String _get_current_branch_name(const bool full_ref);
|
||||||
Array _get_file_diff(const String identifier, const int64_t area);
|
Array _get_file_diff(const String identifier, const int64_t area);
|
||||||
Array _get_line_diff(const String file_path, const String text);
|
Array _get_line_diff(const String file_path, const String text);
|
||||||
Array _get_modified_files_data();
|
Array _get_modified_files_data();
|
||||||
Array _get_previous_commits();
|
Array _get_previous_commits();
|
||||||
String _get_project_name();
|
String _get_project_name();
|
||||||
|
Array _get_remotes();
|
||||||
String _get_vcs_name();
|
String _get_vcs_name();
|
||||||
bool _initialize(const String project_root_path);
|
bool _initialize(const String project_root_path);
|
||||||
bool _is_vcs_initialized();
|
bool _is_vcs_initialized();
|
||||||
|
|||||||
Reference in New Issue
Block a user