A comprehensive model of processes in a discharge capillary is required in order to obtain nominal parameters of a preformed plasma channel suitable for the laser wake-field acceleration. We present three-dimensional magnetohydrodynamics simulations of a hydrogen gas filling process and discharge plasma formation in a short square shaped capillary with gas supply channels. Time evolution of the gas pressure and the plasma density in the capillary channel for a chosen discharge current profile is analyzed. Performed simulations provide distributions of the electric current, the magnetic field, and the electron density along the whole channel, taking into account gas supply areas as well as areas outside of the capillary. Obtained results show that the presence of gas supplies leads to the inhomogeneous plasma density distribution along the capillary channel which has to be taken into account for generating an optimal laser-driven electron beam.