Skip to content

Commit

Permalink
Merge pull request JuliaLang#21553 from JuliaLang/ksh/committish
Browse files Browse the repository at this point in the history
Add a test for mergeing with a committish
  • Loading branch information
kshyatt authored Apr 26, 2017
2 parents 8e12b77 + 1085373 commit 8e283e8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/libgit2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,26 @@ mktempdir() do dir
# ff merge them
@test LibGit2.merge!(repo, [upst_ann], true)
@test LibGit2.is_ancestor_of(string(oldhead), string(LibGit2.head_oid(repo)), repo)

oldhead = LibGit2.head_oid(repo)
LibGit2.branch!(repo, "branch/ff_b")
open(joinpath(LibGit2.path(repo),"ff_file3"),"w") do f
write(f, "333\n")
end
LibGit2.add!(repo, "ff_file3")
LibGit2.commit(repo, "add ff_file3")

open(joinpath(LibGit2.path(repo),"ff_file4"),"w") do f
write(f, "444\n")
end
LibGit2.add!(repo, "ff_file4")
LibGit2.commit(repo, "add ff_file4")
branchhead = LibGit2.head_oid(repo)
LibGit2.branch!(repo, "master")
# switch back, now try to ff-merge the changes
# from branch/a using committish
@test LibGit2.merge!(repo, committish=string(branchhead))
@test LibGit2.is_ancestor_of(string(oldhead), string(LibGit2.head_oid(repo)), repo)
finally
close(repo)
end
Expand Down

0 comments on commit 8e283e8

Please sign in to comment.