Skip to content

Commit

Permalink
Don't rely on GIT_DIR when saving bundles
Browse files Browse the repository at this point in the history
When recloning, that wouldn't prevent saving the initial (large) bundle.
  • Loading branch information
glandium committed Nov 4, 2023
1 parent 2006f10 commit b026c75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
use std::ffi::OsStr;
use std::io::{copy, BufRead, BufReader, Read, Write};
use std::iter::{repeat, IntoIterator};
use std::mem;
use std::num::NonZeroU32;
use std::os::raw::{c_char, c_int};
use std::process::{Command, Stdio};
use std::rc::Rc;
use std::sync::Mutex;
use std::{env, mem};

use bit_vec::BitVec;
use bstr::{BStr, BString, ByteSlice};
Expand Down Expand Up @@ -1401,7 +1401,9 @@ pub fn store_changegroup<R: Read>(input: R, version: u8) {
}
let mut bundle = strbuf::new();
let mut bundle_writer = None;
let mut input = if check_enabled(Checks::UNBUNDLER) && env::var("GIT_DIR").is_ok() {
let mut input = if check_enabled(Checks::UNBUNDLER)
&& CHANGESET_HEADS.lock().unwrap().heads().next().is_some()
{
bundle_writer = Some(BundleWriter::new(BundleSpec::V2Zstd, &mut bundle).unwrap());
let bundle_writer = bundle_writer.as_mut().unwrap();
let info =
Expand Down

0 comments on commit b026c75

Please sign in to comment.