Commit d1159da 1 parent 8ef4d35 commit d1159da Copy full SHA for d1159da
File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,10 @@ impl PluginManager for CoffeeManager {
288
288
plugin. exec_path = new_exec_path;
289
289
290
290
if let Some ( branch) = branch {
291
- let _ = git_checkout ( & plugin. root_path , & branch, verbose) . await ?;
291
+ // FIXME: Where we store the date? how we manage it?
292
+ let ( commit, _) =
293
+ git_checkout ( & plugin. root_path , & branch, verbose) . await ?;
294
+ plugin. commit = Some ( commit) ;
292
295
}
293
296
294
297
log:: debug!( "plugin: {:?}" , plugin) ;
Original file line number Diff line number Diff line change @@ -53,20 +53,14 @@ pub async fn git_checkout(
53
53
path : & str ,
54
54
branch : & str ,
55
55
verbose : bool ,
56
- ) -> Result < UpgradeStatus , CoffeeError > {
57
- let repo = git2:: Repository :: open ( path) . map_err ( |err| error ! ( "{}" , err. message( ) ) ) ?;
58
- let ( local_commit, _) = get_repo_info ! ( repo) ;
59
-
56
+ ) -> Result < ( String , String ) , CoffeeError > {
60
57
let mut cmd = format ! ( "git fetch origin\n " ) ;
61
58
cmd += & format ! ( "git reset --hard\n " ) ;
62
59
cmd += & format ! ( "git checkout origin/{branch}" ) ;
63
60
sh ! ( path, cmd, verbose) ;
64
61
62
+ let repo = git2:: Repository :: open ( path) . map_err ( |err| error ! ( "{}" , err. message( ) ) ) ?;
65
63
let ( upstream_commit, date) = get_repo_info ! ( repo) ;
66
64
67
- if local_commit == upstream_commit {
68
- Ok ( UpgradeStatus :: UpToDate ( upstream_commit, date) )
69
- } else {
70
- Ok ( UpgradeStatus :: Updated ( upstream_commit, date) )
71
- }
65
+ Ok ( ( upstream_commit, date) )
72
66
}
You can’t perform that action at this time.
0 commit comments