Skip to content

Commit 7a75be5

Browse files
committed
fixup! Clean up preparation commit if no pull was performed
1 parent 243a580 commit 7a75be5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

josh-sync/src/sync.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ impl GitSync {
8181
};
8282
let num_roots_before = num_roots()?;
8383

84-
let sha = cmd!(sh, "git rev-parse HEAD").run().context("FAILED to get current commit")?;
84+
let sha = cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;
8585

8686
// Merge the fetched commit.
8787
const MERGE_COMMIT_MESSAGE: &str = "Merge from rustc";
8888
cmd!(sh, "git merge FETCH_HEAD --no-verify --no-ff -m {MERGE_COMMIT_MESSAGE}")
8989
.run()
9090
.context("FAILED to merge new commits, something went wrong")?;
9191

92-
let current_sha = cmd!(sh, "git rev-parse HEAD").run().context("FAILED to get current commit")?;
92+
let current_sha = cmd!(sh, "git rev-parse HEAD").output().context("FAILED to get current commit")?.stdout;
9393
if current_sha == sha {
9494
cmd!(sh, "git reset --hard HEAD^")
9595
.run()

0 commit comments

Comments
 (0)