Commit 4d7920d 1 parent 6173c22 commit 4d7920d Copy full SHA for 4d7920d
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 @@ -318,7 +318,10 @@ impl PluginManager for CoffeeManager {
318
318
plugin. exec_path = new_exec_path;
319
319
320
320
if let Some ( branch) = branch {
321
- let _ = git_checkout ( & plugin. root_path , & branch, verbose) . await ?;
321
+ // FIXME: Where we store the date? how we manage it?
322
+ let ( commit, _) =
323
+ git_checkout ( & plugin. root_path , & branch, verbose) . await ?;
324
+ plugin. commit = Some ( commit) ;
322
325
}
323
326
324
327
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