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
92ec9ed3
Commit
92ec9ed3
authored
Jun 27, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3260 from ethomson/apply_with_reflog_indices
stash: test we apply using reflog-like indices
parents
b4d2c7cb
ee6eed51
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tests/stash/apply.c
+34
-0
No files found.
tests/stash/apply.c
View file @
92ec9ed3
...
...
@@ -413,3 +413,37 @@ void test_stash_apply__progress_cb_can_abort(void)
cl_git_fail_with
(
-
44
,
git_stash_apply
(
repo
,
0
,
&
opts
));
}
void
test_stash_apply__uses_reflog_like_indices_1
(
void
)
{
git_oid
oid
;
cl_git_mkfile
(
"stash/untracked"
,
"untracked
\n
"
);
cl_git_pass
(
git_stash_save
(
&
oid
,
repo
,
signature
,
NULL
,
GIT_STASH_INCLUDE_UNTRACKED
));
assert_status
(
repo
,
"untracked"
,
GIT_ENOTFOUND
);
// stash@{1} is the oldest (first) stash we made
cl_git_pass
(
git_stash_apply
(
repo
,
1
,
NULL
));
cl_assert_equal_i
(
git_index_has_conflicts
(
repo_index
),
0
);
assert_status
(
repo
,
"what"
,
GIT_STATUS_WT_MODIFIED
);
assert_status
(
repo
,
"how"
,
GIT_STATUS_CURRENT
);
assert_status
(
repo
,
"who"
,
GIT_STATUS_WT_MODIFIED
);
assert_status
(
repo
,
"when"
,
GIT_STATUS_WT_NEW
);
assert_status
(
repo
,
"why"
,
GIT_STATUS_INDEX_NEW
);
assert_status
(
repo
,
"where"
,
GIT_STATUS_INDEX_NEW
);
}
void
test_stash_apply__uses_reflog_like_indices_2
(
void
)
{
git_oid
oid
;
cl_git_mkfile
(
"stash/untracked"
,
"untracked
\n
"
);
cl_git_pass
(
git_stash_save
(
&
oid
,
repo
,
signature
,
NULL
,
GIT_STASH_INCLUDE_UNTRACKED
));
assert_status
(
repo
,
"untracked"
,
GIT_ENOTFOUND
);
// stash@{0} is the newest stash we made immediately above
cl_git_pass
(
git_stash_apply
(
repo
,
0
,
NULL
));
cl_assert_equal_i
(
git_index_has_conflicts
(
repo_index
),
0
);
assert_status
(
repo
,
"untracked"
,
GIT_STATUS_WT_NEW
);
}
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