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
970c3c71
Unverified
Commit
970c3c71
authored
Feb 26, 2022
by
Edward Thomson
Committed by
GitHub
Feb 26, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6234 from libgit2/ethomson/v1.4.2
v1.4.2
parents
fdd15bcf
f2c5d1b1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
4 deletions
+55
-4
include/git2/version.h
+2
-2
src/remote.c
+1
-1
src/win32/findfile.c
+1
-1
tests/network/fetchlocal.c
+41
-0
tests/win32/systemdir.c
+10
-0
No files found.
include/git2/version.h
View file @
970c3c71
...
@@ -7,10 +7,10 @@
...
@@ -7,10 +7,10 @@
#ifndef INCLUDE_git_version_h__
#ifndef INCLUDE_git_version_h__
#define INCLUDE_git_version_h__
#define INCLUDE_git_version_h__
#define LIBGIT2_VERSION "1.4.
1
"
#define LIBGIT2_VERSION "1.4.
2
"
#define LIBGIT2_VER_MAJOR 1
#define LIBGIT2_VER_MAJOR 1
#define LIBGIT2_VER_MINOR 4
#define LIBGIT2_VER_MINOR 4
#define LIBGIT2_VER_REVISION
1
#define LIBGIT2_VER_REVISION
2
#define LIBGIT2_VER_PATCH 0
#define LIBGIT2_VER_PATCH 0
#define LIBGIT2_SOVERSION "1.4"
#define LIBGIT2_SOVERSION "1.4"
...
...
src/remote.c
View file @
970c3c71
...
@@ -1852,7 +1852,7 @@ static int update_one_tip(
...
@@ -1852,7 +1852,7 @@ static int update_one_tip(
}
}
if
(
callbacks
&&
callbacks
->
update_tips
!=
NULL
&&
if
(
callbacks
&&
callbacks
->
update_tips
!=
NULL
&&
callbacks
->
update_tips
(
refname
.
ptr
,
&
old
,
&
head
->
oid
,
callbacks
->
payload
)
<
0
)
(
error
=
callbacks
->
update_tips
(
refname
.
ptr
,
&
old
,
&
head
->
oid
,
callbacks
->
payload
)
)
<
0
)
git_error_set_after_callback_function
(
error
,
"git_remote_fetch"
);
git_error_set_after_callback_function
(
error
,
"git_remote_fetch"
);
done
:
done
:
...
...
src/win32/findfile.c
View file @
970c3c71
...
@@ -222,7 +222,7 @@ int git_win32__find_system_dirs(git_str *out, const char *subdir)
...
@@ -222,7 +222,7 @@ int git_win32__find_system_dirs(git_str *out, const char *subdir)
has_regdir
=
(
find_sysdir_in_registry
(
regdir
)
==
0
);
has_regdir
=
(
find_sysdir_in_registry
(
regdir
)
==
0
);
if
(
!
has_pathdir
&&
!
has_regdir
)
if
(
!
has_pathdir
&&
!
has_regdir
)
return
GIT_ENOTFOUND
;
return
0
;
/*
/*
* Usually the git in the path is the same git in the registry,
* Usually the git in the path is the same git in the registry,
...
...
tests/network/fetchlocal.c
View file @
970c3c71
...
@@ -509,3 +509,44 @@ void test_network_fetchlocal__prune_load_fetch_prune_config(void)
...
@@ -509,3 +509,44 @@ void test_network_fetchlocal__prune_load_fetch_prune_config(void)
git_remote_free
(
origin
);
git_remote_free
(
origin
);
git_repository_free
(
repo
);
git_repository_free
(
repo
);
}
}
static
int
update_tips_error
(
const
char
*
ref
,
const
git_oid
*
old
,
const
git_oid
*
new
,
void
*
data
)
{
int
*
callcount
=
(
int
*
)
data
;
GIT_UNUSED
(
ref
);
GIT_UNUSED
(
old
);
GIT_UNUSED
(
new
);
(
*
callcount
)
++
;
return
-
1
;
}
void
test_network_fetchlocal__update_tips_error_is_propagated
(
void
)
{
git_repository
*
repo
;
git_reference_iterator
*
iterator
;
git_reference
*
ref
;
git_remote
*
remote
;
git_fetch_options
options
=
GIT_FETCH_OPTIONS_INIT
;
int
callcount
=
0
;
cl_git_pass
(
git_repository_init
(
&
repo
,
"foo.git"
,
true
));
cl_set_cleanup
(
cleanup_local_repo
,
"foo.git"
);
cl_git_pass
(
git_remote_create_with_fetchspec
(
&
remote
,
repo
,
"origin"
,
cl_git_fixture_url
(
"testrepo.git"
),
"+refs/heads/*:refs/remotes/update-tips/*"
));
options
.
callbacks
.
update_tips
=
update_tips_error
;
options
.
callbacks
.
payload
=
&
callcount
;
cl_git_fail
(
git_remote_fetch
(
remote
,
NULL
,
&
options
,
NULL
));
cl_assert_equal_i
(
1
,
callcount
);
cl_git_pass
(
git_reference_iterator_glob_new
(
&
iterator
,
repo
,
"refs/remotes/update-tips/**/"
));
cl_assert_equal_i
(
GIT_ITEROVER
,
git_reference_next
(
&
ref
,
iterator
));
git_reference_iterator_free
(
iterator
);
git_remote_free
(
remote
);
git_repository_free
(
repo
);
}
tests/win32/systemdir.c
View file @
970c3c71
...
@@ -326,3 +326,13 @@ void test_win32_systemdir__prefers_path_to_registry(void)
...
@@ -326,3 +326,13 @@ void test_win32_systemdir__prefers_path_to_registry(void)
git_config_free
(
cfg
);
git_config_free
(
cfg
);
#endif
#endif
}
}
void
test_win32_systemdir__no_git_installed
(
void
)
{
#ifdef GIT_WIN32
git_str
out
=
GIT_STR_INIT
;
cl_git_pass
(
git_win32__find_system_dirs
(
&
out
,
"etc"
));
cl_assert_equal_s
(
out
.
ptr
,
""
);
#endif
}
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