mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Improved handling of git syntax names with no git repository
This makes "is_git_repository()" return non-NULL for all file names that match the git name pattern, even if we don't find an actual git repository there. That way, we won't fall back to writing out an XML file with an odd filename. If there is no actual git repository, we return a special invalid dummy pointer, and then the git reading and writing routines will catch it and return the appropriate error. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e70bbb637e
commit
27c36ec4cf
3 changed files with 30 additions and 6 deletions
|
@ -1243,7 +1243,11 @@ static int do_git_load(git_repository *repo, const char *branch)
|
|||
*/
|
||||
int git_load_dives(struct git_repository *repo, const char *branch)
|
||||
{
|
||||
int ret = do_git_load(repo, branch);
|
||||
int ret;
|
||||
|
||||
if (repo == dummy_git_repository)
|
||||
return report_error("Unable to open git repository at '%s'", branch);
|
||||
ret = do_git_load(repo, branch);
|
||||
git_repository_free(repo);
|
||||
free((void *)branch);
|
||||
finish_active_dive();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue