mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Stop using the "git descriptor file" model
Instead, just encode the git repository information in the filename. We want to make it much harder to make it match a real filename, but to still allow easy browsing with the file manager interface. So the git repository "filename" format is the path to the git repository directory, with the branch name encoded as "[branch]" at the end rather than the "path:branch" format that we used in the descriptor file. [ For example, on Windows, a filename like "c:\my.xml" could be interpreted as the branchame "\my.xml" in the repository in the directory "c" ] In particular, with this model, no filename that ends with ".xml" could possibly ever be considered a git repository name, since the last character of a git pathname is always ']'. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5b3dab719e
commit
7902af246c
5 changed files with 76 additions and 87 deletions
7
dive.h
7
dive.h
|
|
@ -685,8 +685,11 @@ extern void save_dives(const char *filename);
|
|||
extern void save_dives_logic(const char *filename, bool select_only);
|
||||
extern void save_dive(FILE *f, struct dive *dive);
|
||||
extern void export_dives_uddf(const char *filename, const bool selected);
|
||||
extern int git_save_dives(int fd, bool select_only);
|
||||
extern int git_load_dives(char *where);
|
||||
|
||||
struct git_repository;
|
||||
extern struct git_repository *is_git_repository(const char *filename, const char **branchp);
|
||||
extern int git_save_dives(struct git_repository *, const char *, bool select_only);
|
||||
extern int git_load_dives(struct git_repository *, const char *);
|
||||
|
||||
extern int subsurface_rename(const char *path, const char *newpath);
|
||||
extern int subsurface_open(const char *path, int oflags, mode_t mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue