mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
26 lines
570 B
C++
26 lines
570 B
C++
#include "Core.h"
|
|
|
|
int GetRepo(String& path)
|
|
{
|
|
if(IsNull(path))
|
|
return NOT_REPO_DIR;
|
|
if(DirectoryExists(AppendFileName(path, ".svn")) || DirectoryExists(AppendFileName(path, "_svn")))
|
|
return SVN_DIR;
|
|
for(;;) {
|
|
if(DirectoryExists(AppendFileName(path, ".git")))
|
|
return GIT_DIR;
|
|
if(DirectoryExists(AppendFileName(path, ".svn")))
|
|
return SVN_DIR;
|
|
String path0 = path;
|
|
path = GetFileFolder(path);
|
|
if(path == path0)
|
|
break;
|
|
}
|
|
return NOT_REPO_DIR;
|
|
}
|
|
|
|
int GetRepoKind(const String& p)
|
|
{
|
|
String pp = p;
|
|
return GetRepo(pp);
|
|
}
|