Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
32a4e3b7
Commit
32a4e3b7
authored
Sep 29, 2012
by
Sven Strickroth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code to find msysgit path using registry to own method
Signed-off-by: Sven Strickroth <email@cs-ware.de>
parent
549ee21a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
src/fileops.c
+14
-8
No files found.
src/fileops.c
View file @
32a4e3b7
...
...
@@ -514,11 +514,9 @@ int find_system_file_using_path(git_buf *path, const char *filename)
return
GIT_ENOTFOUND
;
}
#endif
int
git_futils_find_system_file
(
git_buf
*
path
,
const
char
*
filename
)
int
find_system_file_using_registry
(
git_buf
*
path
,
const
char
*
filename
)
{
#ifdef GIT_WIN32
#ifndef _WIN64
#define REG_MSYSGIT_INSTALL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
#else
...
...
@@ -531,10 +529,6 @@ int git_futils_find_system_file(git_buf *path, const char *filename)
DWORD
dwType
=
REG_SZ
;
DWORD
dwSize
=
MAX_PATH
;
// try to find git.exe/git.cmd on path
if
(
!
find_system_file_using_path
(
path
,
filename
))
return
0
;
root
.
len
=
0
;
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
REG_MSYSGIT_INSTALL
,
0
,
KEY_ALL_ACCESS
,
&
hKey
)
==
ERROR_SUCCESS
)
{
...
...
@@ -563,18 +557,30 @@ int git_futils_find_system_file(git_buf *path, const char *filename)
}
return
0
;
}
#endif
int
git_futils_find_system_file
(
git_buf
*
path
,
const
char
*
filename
)
{
#ifdef GIT_WIN32
// try to find git.exe/git.cmd on path
if
(
!
find_system_file_using_path
(
path
,
filename
))
return
0
;
// try to find msysgit installation path using registry
if
(
!
find_system_file_using_registry
(
path
,
filename
))
return
0
;
#else
if
(
git_buf_joinpath
(
path
,
"/etc"
,
filename
)
<
0
)
return
-
1
;
if
(
git_path_exists
(
path
->
ptr
)
==
true
)
return
0
;
#endif
git_buf_clear
(
path
);
giterr_set
(
GITERR_OS
,
"The system file '%s' doesn't exist"
,
filename
);
return
GIT_ENOTFOUND
;
#endif
}
int
git_futils_find_global_file
(
git_buf
*
path
,
const
char
*
filename
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment