From ba740ac85bde7591d754a4409f0b42774c4a7250 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Mon, 15 Aug 2016 16:48:19 -0700 Subject: [PATCH] rebase: Print a message and stop if base unchanged and not interactive Rebase has nothing to do in this case. --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index b0f14c719eae6ad42ebf9be5717da50518eae9dd..e74dec2618c8d2f4c179fe162d5df2177569e2e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1351,6 +1351,11 @@ fn rebase(repo: &Repository, m: &ArgMatches) -> Result<()> { }; let newbase = onto.unwrap_or(base.id()); + if newbase == base.id() && !interactive { + println!("Nothing to do: base unchanged and not rebasing interactively"); + return Ok(()); + } + let (base_short, _) = try!(commit_summarize_components(&repo, base.id())); let (newbase_short, _) = try!(commit_summarize_components(&repo, newbase)); let (series_short, _) = try!(commit_summarize_components(&repo, series.id()));