commit: Fix invalid assignment from owned expression to unowned variable

commit is an unowned parameter of stage_submodule() and be used to keep
an owned reference returned by repo.lookup().

https://bugzilla.gnome.org/show_bug.cgi?id=780314
This commit is contained in:
Rico Tzschichholz 2017-03-20 16:42:33 +01:00
parent a19e2186ac
commit 5b195d645f

View file

@ -251,11 +251,12 @@ namespace GitgCommit
return false;
}
if (commit == null)
Ggit.Commit sub_commit = commit;
if (sub_commit == null)
{
try
{
commit = repo.lookup<Gitg.Commit>(sub.submodule.get_workdir_id());
sub_commit = repo.lookup<Gitg.Commit>(sub.submodule.get_workdir_id());
}
catch (Error e)
{
@ -268,7 +269,7 @@ namespace GitgCommit
try
{
yield stage.stage_commit(sub.path, commit);
yield stage.stage_commit(sub.path, sub_commit);
}
catch (Error e)
{