aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/dive.h1
-rw-r--r--core/file.c6
-rw-r--r--core/git-access.h1
3 files changed, 6 insertions, 2 deletions
diff --git a/core/dive.h b/core/dive.h
index be721348c..82cda6719 100644
--- a/core/dive.h
+++ b/core/dive.h
@@ -675,7 +675,6 @@ extern int parse_cobalt_buffer(sqlite3 *handle, const char *url, const char *buf
extern int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct dive_table *table);
extern int parse_dlf_buffer(unsigned char *buffer, size_t size);
-extern int check_git_sha(const char *filename);
extern int parse_file(const char *filename);
extern int parse_csv_file(const char *filename, char **params, int pnr, const char *csvtemplate);
extern int parse_seabear_csv_file(const char *filename, char **params, int pnr, const char *csvtemplate);
diff --git a/core/file.c b/core/file.c
index 685fa82a7..52c93a719 100644
--- a/core/file.c
+++ b/core/file.c
@@ -435,13 +435,17 @@ static int parse_file_buffer(const char *filename, struct memblock *mem)
return parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, NULL);
}
-int check_git_sha(const char *filename)
+int check_git_sha(const char *filename, struct git_repository **git_p, const char **branch_p)
{
struct git_repository *git;
const char *branch = NULL;
char *current_sha = strdup(saved_git_id);
git = is_git_repository(filename, &branch, NULL, false);
+ if (git_p)
+ *git_p = git;
+ if (branch_p)
+ *branch_p = branch;
if (prefs.cloud_git_url &&
strstr(filename, prefs.cloud_git_url)
&& git == dummy_git_repository) {
diff --git a/core/git-access.h b/core/git-access.h
index 3a0c5160a..6dbc22488 100644
--- a/core/git-access.h
+++ b/core/git-access.h
@@ -15,6 +15,7 @@ struct git_oid;
struct git_repository;
#define dummy_git_repository ((git_repository *)3ul) /* Random bogus pointer, not NULL */
extern struct git_repository *is_git_repository(const char *filename, const char **branchp, const char **remote, bool dry_run);
+extern int check_git_sha(const char *filename, git_repository **git_p, const char **branch_p);
extern int sync_with_remote(struct git_repository *repo, const char *remote, const char *branch, enum remote_transport rt);
extern int git_save_dives(struct git_repository *, const char *, const char *remote, bool select_only);
extern int git_load_dives(struct git_repository *, const char *);