chiark / gitweb /
Arrange for the special dgit remote to be skipped by git fetch --all etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 9 Oct 2016 11:11:38 +0000 (12:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Oct 2016 00:01:10 +0000 (01:01 +0100)
Closes:#827892.

Not quite the patch from Sean: we want to do this on every fetch, and
we don't overwrite the user's configuration if for some reason they
have set this (hopefully they haven't...)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index 54583cff95297453ba070a7b3edff8ab540e5c13..7bc0a110808d737f33ae0c9b85f3d09ba117b2a4 100644 (file)
@@ -77,6 +77,8 @@ dgit (1.5~~) unstable; urgency=medium
   * Tidy up refs/dgit-fetch/ after dgit fetch (if successful).
   * Fix handling of in-archive copies.
   * Don't break if user has push.followTags=true.  Closes:#827878.
+  * Arrange for the special dgit remote to be skipped by git fetch --all
+    etc.  Closes:#827892.
 
   Test suite:
   * When sbuild fails, do not crash due to sed not finding the log
diff --git a/dgit b/dgit
index a96f4711bb0d8c5fd7f3072bd3138b8b5733b489..34152eec985ae6aeb36b1b259a2498262025887d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2136,6 +2136,8 @@ sub mergeinfo_version ($) {
 }
 
 sub fetch_from_archive () {
+    ensure_setup_existing_tree();
+
     # Ensures that lrref() is what is actually in the archive, one way
     # or another, according to us - ie this client's
     # appropritaely-updated archive view.  Also returns the commit id.
@@ -2535,6 +2537,13 @@ sub setup_useremail (;$) {
     $setup->('name', 'DEBFULLNAME');
 }
 
+sub ensure_setup_existing_tree () {
+    my $k = "remote.$remotename.skipdefaultupdate";
+    my $c = git_get_config $k;
+    return if defined $c;
+    set_local_git_config $k, 'true';
+}
+
 sub setup_new_tree () {
     setup_mergechangelogs();
     setup_useremail();