bug: git mv dir with submodule in dir/sub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

First, many thanks for all your work on git. It has been an
invaluable tool.

I believe I've found a bug. Submodules break when I use ``git mv``
to rename a directory, which contains a submodule as one of its
_sub_directories.

Here's the script I've been using to reproduce:

	#!/bin/bash

	# Settings
	REPO_TO_CLONE="$HOME/www/wfpl.git"

	# run in new directory
	export REPODIR="git-bug-$(date '+%s')"
	mkdir "$REPODIR" || exit $?
	cd "$REPODIR" || exit $?

	git --version

	# make a git repo with a submodule
	git init || exit $?
	mkdir old || exit $?
	git submodule add ~/www/wfpl.git old/wfpl || exit $?

	# run the command that borks the submodule
	git mv old new || exit $?

	# demonstrate that it's borked:
	git status || exit $?
	# for me this command produces:
	#     fatal: Could not chdir to '../../../../old/wfpl': No such file or directory
	#     fatal: 'git status --porcelain' failed in submodule new/wfpl

I run that and get this:

	git version 2.3.1.431.g836cf63
	Initialized empty Git repository in
	/home/jasonwoof/git-bug/git-bug-1425397321/.git/
	Cloning into 'old/wfpl'...
	done.
	fatal: Could not chdir to '../../../../old/wfpl': No such file or
	directory
	fatal: 'git status --porcelain' failed in submodule new/wfpl
	zsh: exit 128   ./script.sh

I got this same error (every time) with git-2.1.4-2.1 from debian
unstable, and from github's master (7f4ba4b6e3ba7), and from
github's pu branch (836cf6345)

All of the above running on debian unstable.

You'll need to change REPO_TO_CLONE of course.

It's probably worth noting that if I use ``git mv`` on the
submodule directly, it works fine. eg if I replace the ``git mv``
line in the above script with:

	mkdir new
	git mv old/wfpl new/wfpl

then it works fine (no error messages).


I am not subscribed to this list, so please remember to reply-all
if I can be of further assistance.

Thanks you!

-- 
Jason
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]